Data processing method and device based on blockchain
By generating public keys and private keys in the blockchain network and using smart contract verification, the security problem of user login password storage is solved and higher security is achieved.
Patent Information
- Application Number
- CN202210979257.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-16
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-08-16
AI Technical Summary
In the existing technology, when user login passwords are stored in a database, there is a security problem that the information may be tampered with, making it difficult to effectively prevent leakage and tampering.
Through the decentralization characteristics of the blockchain, public keys and private keys are generated, and the public keys and user identity information are bound and stored in the blockchain network, and the private keys and login passwords are bound and stored in the server, using smart contracts Verify and sign to ensure the security of login information.
It effectively prevents the leakage and tampering of login passwords, improves the security of user identity verification information, and ensures the security of accounts.
Smart Images

Figure CN115378605B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based data processing method and device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] When conducting transactions on the Internet, the user of the transaction needs to have his own account. After registering, logging in and other operations to authenticate the user's identity, the user can conduct transactions through the account. User identity authentication information (such as login password) is one of the data with the highest security level in the database. In related technologies, the transaction institution usually stores the user login password in its own or a third-party database. However, this storage method may cause security issues such as information tampering. Summary of the invention
[0004] An embodiment of the present invention provides a data processing method based on blockchain, which is used to improve the security of user identity authentication information through the decentralized characteristics of blockchain. The method includes: a first node receives a user's registration operation, and the information of the registration operation includes the user's identity information and login password; the first node calls a smart contract pre-deployed in the blockchain network to generate a pair of public keys and private keys, and a unique identifier of the user; the first node binds the public key with the user's identity information to generate registration information; the first node broadcasts the registration information to the blockchain network to synchronously store the registration information in the account books maintained by all nodes in the blockchain network; the first node binds the private key, the unique identifier and the login password, and stores them in a server.
[0005] Optionally, after the first node binds the private key, the unique identifier and the login password and stores them in the server, the method may also include: the first node receives the user's login operation; wherein the login operation includes inputting the unique identifier and the login password; the first node calls the smart contract and sends a request to the server to verify the login operation; wherein the request carries the unique identifier and the login password; when the server determines that the login password corresponding to the unique identifier is the same as the login password input for the login operation, the first node receives the private key corresponding to the unique identifier returned by the server; the first node signs the information of the login operation based on the private key to generate a digital signature; the first node broadcasts the information of the login operation and the digital signature to the blockchain network, so that other nodes in the blockchain network verify the digital signature according to the public key stored in the account book maintained by themselves; after the first node receives the message of successful verification returned by more than a preset number of nodes, the first node logs in to the user's account; the first node calls the smart contract to generate login information, and broadcasts the login information to the blockchain network.
[0006] Optionally, after the first node logs in to the user's account, the method may also include: the first node receives the user's modification operation; when the modification operation includes modifying the user's identity information, the first node calls the smart contract to generate first modification information according to the modification operation, and broadcasts the first modification information to the blockchain network; when the modification operation includes modifying the user's login password, the first node calls the smart contract to generate second modification information according to the modification operation, and sends a modification request to the server, so that the server modifies the login password bound to the unique identifier based on the second modification information.
[0007] Optionally, after the first node logs in to the user's account, the method may also include: the first node receives the user's logout operation; the first node calls the smart contract, broadcasts information about the logout operation to the blockchain network, and requests the server to log out the login password and private key associated with the unique identifier.
[0008] An embodiment of the present invention also provides a blockchain-based data processing device, which is used to improve the security of user identity authentication information through the decentralized characteristics of blockchain. The device includes: a first receiving unit, which is used to receive the user's registration operation through the first node, and the information of the registration operation includes the user's identity information and login password; a first generating unit, which is used to call the smart contract pre-deployed in the blockchain network through the first node to generate a pair of public keys and private keys, and the user's unique identifier; a second generating unit, which is used to bind the public key with the user's identity information through the first node to generate registration information; a first broadcasting unit, which is used to broadcast the registration information to the blockchain network through the first node, so as to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; a binding unit, which is used to bind the private key, the unique identifier and the login password through the first node, and store them in the server.
[0009] Optionally, the device may also include: a second receiving unit, which is used to receive the user's login operation through the first node after the first node binds the private key, the unique identifier and the login password and stores them in the server; wherein the login operation includes inputting the unique identifier and the login password; a sending unit, which is used to call the smart contract through the first node and send a request to the server to verify the login operation; wherein the request carries the unique identifier and the login password; a third receiving unit, which is used to receive the private key corresponding to the unique identifier returned by the server through the first node when the server determines that the login password corresponding to the unique identifier is the same as the login password input for the login operation; a third generating unit, which is used to sign the information of the login operation based on the private key through the first node to generate a digital signature; a second broadcasting unit, which is used to broadcast the information of the login operation and the digital signature to the blockchain network through the first node, so that other nodes in the blockchain network verify the digital signature according to the public key stored in the account book maintained by themselves; a login unit, which is used to log in to the user's account through the first node after the first node receives the message of successful verification returned by more than a preset number of nodes; a third broadcasting unit, which is used to call the smart contract through the first node to generate login information, and broadcast the login information to the blockchain network.
[0010] Optionally, the device may also include: a fourth receiving unit, used for the first node to receive the user's modification operation after the first node logs in to the user's account; a fourth broadcasting unit, used for, when the modification operation includes modifying the user's identity information, calling the smart contract through the first node to generate first modification information according to the modification operation, and broadcasting the first modification information to the blockchain network; an execution unit, used for, when the modification operation includes modifying the user's login password, the first node calling the smart contract to generate second modification information according to the modification operation, and sending a modification request to the server, so that the server modifies the login password bound to the unique identifier based on the second modification information.
[0011] Optionally, the device may also include: a fifth receiving unit, used to receive the user's logout operation through the first node after the first node logs in to the user's account; a fifth broadcasting unit, used to call the smart contract through the first node, broadcast the information of the logout operation to the blockchain network, and request the server to log out the login password and private key associated with the unique identifier.
[0012] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned blockchain-based data processing method when executing the computer program.
[0013] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned blockchain-based data processing method is implemented.
[0014] An embodiment of the present invention also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned blockchain-based data processing method is implemented.
[0015] In an embodiment of the present invention, a user's registration operation is received by a first node, and the information of the registration operation includes the user's identity information and login password; the first node calls a smart contract pre-deployed in the blockchain network to generate a pair of public keys and private keys, and a unique identifier of the user; the first node binds the public key to the user's identity information to generate registration information; the first node broadcasts the registration information to the blockchain network to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; the first node binds the private key, the unique identifier and the login password, and stores them in the server. The private key and the login password can be bound and stored, and the public key can be stored through the blockchain network, so as to avoid the disclosure of the login password and prevent the leakage of the login password. At the same time, the characteristics of blockchain technology can be used to verify the private key bound to the login password through the publicly stored public key to prevent the login password from being tampered with, thereby improving the security of the user's identity authentication information. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0017] Figure 1 A schematic diagram of a data processing method based on blockchain provided in an embodiment of the present invention Figure 1 ;
[0018] Figure 2 A schematic diagram of a data processing method based on blockchain provided in an embodiment of the present invention Figure 2 ;
[0019] Figure 3 A schematic diagram of a data processing method based on blockchain provided in an embodiment of the present invention Figure 3 ;
[0020] Figure 4 A schematic diagram of a data processing method based on blockchain provided in an embodiment of the present invention Figure 4 ;
[0021] Figure 5 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0023] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.
[0024] The following are some technical terms and nouns involved in the embodiments of the present invention:
[0025] web3.js: web3.js is a collection of libraries that can interact with local or remote Ethereum nodes using HTTP or IPC. The web3 JavaScript library is able to interact with the Ethereum blockchain. It can retrieve user accounts, send transactions, interact with smart contracts, etc.
[0026] Testrpc: This is a complete in-memory blockchain that only exists on the current development device. Compared to the Geth private chain environment, TestRPC returns in real time when executing transactions, without waiting for the default block time, so that the code can be verified quickly and feedback can be obtained immediately when errors occur.
[0027] Truffle: Truffle is a development framework for the Ethereum-based Solidity language. It is based on Javascript and provides built-in smart contract compilation, linking, deployment and binary file management. It is scriptable and extensible.
[0028] P2P network: P2P (Peer to Peer) network is the basic network architecture of the entire blockchain. It does not require a centralized server or centralized router. All nodes are completely equal. The loss of one or more nodes in the network will not affect the integrity of the network data. At the same time, P2P can realize the sharing of storage resources and computing resources, effectively improving resource utilization.
[0029] Blockchain cryptography: Common cryptographic algorithms include symmetric encryption algorithms, asymmetric encryption algorithms, and message digests. Symmetric encryption algorithms have the characteristics of high encryption and decryption efficiency, easy operation, and convenient standardization. They are commonly used data encryption technologies in cyberspace and information processing. Compared with symmetric encryption algorithms, asymmetric encryption has lower encryption and decryption efficiency, but has higher security. It is a commonly used encryption algorithm in blockchain technology. Message digests can convert messages of any length into a fixed-length hash value through a hash algorithm within a certain period of time, that is, h = H(m). Hash functions are often used to verify data integrity and identity authentication.
[0030] Merkle Tree algorithm: In the blockchain, Merkle Tree is used to summarize all transactions in a block and generate a fingerprint of all transaction sets in a block. In the Merkle tree, any change in a node will affect the value of the root node, thus ensuring the immutability of transactions on the blockchain. When the previous transaction changes, it can be cut from the tree, so that the old block can be compressed.
[0031] Consensus algorithm: A mechanism for each node in the blockchain to reach a consensus in order to verify the accounting. The blockchain is built on a P2P network. How to make all nodes in the entire network reach a consensus on the accounting and make the final result credible in the absence of a trusted third party and traitors? This is the consensus algorithm, which is also the core content of the blockchain.
[0032] Ethereum: Ethereum is a smart contract development platform that provides the basic conditions necessary for contract development, including smart contract scripts, contract programming languages, Ethereum virtual machines (EVM), Whisper communication systems, Swarm information management systems, IPFS file systems, and graphical clients and command line operation interfaces based on multiple languages. With the help of the Ethereum platform, decentralized applications DApp can be easily developed.
[0033] The present invention provides a data processing method based on blockchain. Figure 1 The following is a schematic diagram of a data processing method based on blockchain provided by an embodiment of the present invention. Figure 1 .like Figure 1 As shown, the method may include the following steps:
[0034] Step 101: A first node receives a registration operation from a user, where information of the registration operation includes the user's identity information and login password.
[0035] Identity information may include user name, user role, user address, gender, age, etc.
[0036] The first node is a node in the blockchain network. The blockchain network may include multiple nodes. The embodiment of the present invention may be run in a private chain network. An example way to build a private chain network may be to first configure a private chain for a single node to ensure that a single node can normally access the private chain network, and then build a multi-node cluster in the private chain.
[0037] like Figure 2 As shown, the blockchain network in the embodiment of the present invention may include the following five layers:
[0038] The first layer is mainly the technical environment that blockchain relies on, such as the P2P network and cryptography introduced above;
[0039] The second layer is the operations, operation objects and environment involved in the blockchain, among which the consensus algorithm determines the consensus mechanism of the entire blockchain network, and all nodes must work in accordance with this mechanism. The consensus mechanism used in the present invention is proof of work (POW), that is, all blocks require all miners in the entire network to continuously compete for mining;
[0040] The third layer is the Ethereum virtual machine and the remote procedure call protocol RPC (Remote Procedure Call). The Ethereum virtual machine is similar to the Java virtual machine, providing a running environment for programs developed based on Ethereum, while RPC ensures the communication between programs developed based on Ethereum on the network.
[0041] The fourth layer is the smart contract layer. All business logics that need to interact with the blockchain in this layer need to be implemented by writing smart contracts. The implementation of smart contracts in this invention uses the solidity language;
[0042] The fifth layer is the application layer. The business logic written in the smart contract supports the entire application layer and provides services and interfaces for it. The application layer needs to encapsulate the interface and implement interaction with the smart contract layer.
[0043] The embodiment of the present invention can be implemented through a decentralized application DApp. The decentralized application DApp may include the following core processes:
[0044] 1) Use the solidity language to write a smart contract (the contract file ends with .sol), send it to the smart contract compiler through the interface provided by web3.js, and obtain the binary code;
[0045] 2) Feedback the binary content of the contract to the system front end;
[0046] 3) Deploy the compiled smart contract to the network, obtain the hash address and ABI (ABI is the binary representation of the contract interface) of the smart contract in the blockchain. For the convenience of development, it will be deployed to the test network through testrpc;
[0047] 4) After the contract is deployed to the blockchain network, the contract address and ABI are fed back to the front end;
[0048] 5) The front end calls the smart contract through Address+ABI+nonce to complete the operation of interacting with the contract, where nonce is the transaction number, which will automatically increase by 1 after each interaction to prevent duplicate transactions.
[0049] Step 102: The first node calls a smart contract pre-deployed in the blockchain network to generate a pair of public and private keys and a unique identifier of the user.
[0050] Smart contracts are pre-deployed in the network. Smart contracts can be written in solidity (contract files end with .sol) and sent to the smart contract compiler through the interface provided by web3.js to implement the business logic of decentralized applications. Then, the compiled smart contract is deployed to the network to obtain the hash address and ABI (ABI is the binary representation of the contract interface) of the smart contract in the blockchain. In this way, any node can call the smart contract based on the ABI.
[0051] The functions of smart contracts can include generating a pair of public and private keys, as well as a unique identifier for the user. The unique identifier of a user is a globally unique identifier in the blockchain network, which can be a hash address, specifically a string of hash values. The hash address can be used to quickly find the user in the ledger. The unique identifier of the user cannot be modified.
[0052] Step 103: The first node binds the public key to the user's identity information to generate registration information.
[0053] The generated public key is information that is public in the blockchain network. The public key is bound to the user's identity information to generate registration information.
[0054] In step 104, the first node broadcasts the registration information to the blockchain network, so as to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network.
[0055] The registration information is broadcast to the blockchain network and stored synchronously in the ledgers maintained by all nodes in the blockchain network.
[0056] All nodes in the blockchain network can work based on a consensus algorithm. For example, the consensus algorithm used in the embodiment of the present invention can select proof of work (POW). All blocks require continuous competition among the nodes in the blockchain network. After the first node broadcasts the registration information to the blockchain network, each node can first package the received registration information into a new block. After any node calculates the answer to the question indicating that it has the right to record the new block, it can broadcast the new block it has packaged to the blockchain network. After each node in the blockchain network receives the new block and verifies that the answer calculated by the node is correct, it stores the new block in the blockchain.
[0057] Step 105: The first node binds the private key, the unique identifier and the login password, and stores them in the server.
[0058] The private key corresponding to the public key can be bound to the unique identifier and the login password and stored in the server. Optionally, the server can be a server designated by the transaction institution. In this way, the login password can be saved in a relatively safe way, and the work of verifying the login password is handed over to the nodes in the blockchain network, thereby avoiding the disclosure of the login password in the blockchain network and preventing the login password from being leaked. At the same time, the characteristics of blockchain technology can be used to verify the private key bound to the login password through the publicly stored public key to prevent the login password from being tampered with, thereby improving the security of user identity authentication information.
[0059] After the first node binds the private key, unique identifier and login password and stores them in the server, if a login operation is received, it can be done as follows Figure 3 The following steps are shown to verify whether the login operation of the first node is legal:
[0060] Step 201: The first node receives a login operation from a user; wherein the login operation includes inputting a unique identifier and a login password.
[0061] The unique ID is used to uniquely identify the user account and is used for search. The login password is used to authenticate the user identity.
[0062] Step 202: The first node calls the smart contract and sends a request to the server to verify the login operation; the request carries a unique identifier and a login password. After receiving the request, the server searches for the corresponding login password and private key based on the unique identifier. If the login password corresponding to the unique identifier is the same as the login password entered by the user during the login operation, the verification is successful.
[0063] Step 203: When the server determines that the login password corresponding to the unique identifier is the same as the login password input in the login operation, the first node receives the private key corresponding to the unique identifier returned by the server.
[0064] Step 204: The first node signs the information of the login operation based on the private key to generate a digital signature.
[0065] In step 205, the first node broadcasts the login operation information and the digital signature to the blockchain network, so that other nodes in the blockchain network can verify the digital signature according to the public key stored in the account book maintained by themselves.
[0066] The information of the login operation may include a unique identifier and the identity information of the user, etc. After receiving the broadcasted login operation information and digital signature, other nodes verify the digital signature based on the public key. After the verification is successful, it is determined that the login operation is valid.
[0067] Step 206: After the first node receives signature verification success messages returned by more than a preset number of nodes, the first node logs in to the user's account.
[0068] The preset number can be calculated based on a preset ratio threshold. For example, if the number of nodes in the blockchain network is x and the ratio threshold is y, then the preset number is x×y.
[0069] The first node is allowed to log in to the account only when more than a preset number of nodes have successfully verified the signature, that is, voted that the login operation of the first node is valid.
[0070] Step 207: The first node calls the smart contract to generate login information and broadcasts the login information to the blockchain network.
[0071] After the login operation is successful, the first node calls the smart contract to generate login information for this login. Optionally, in an embodiment of the present invention, after any operation is successful, the execution information of this operation can be used to generate a transaction voucher, and the transaction voucher can be added to a new block and stored in the account book.
[0072] Optionally, after the first node logs in to the user's account, if the first node receives the user's modification operation, the modification operation may include modification of the user's identity information and / or modification of the user's login password. In the case where the modification operation includes modification of the user's identity information, the first node can call the smart contract to generate first modification information according to the modification operation, and broadcast the first modification information to the blockchain network. In the case where the modification operation includes modification of the user's login password, the first node calls the smart contract to generate second modification information according to the modification operation, and sends a modification request to the server, so that the server modifies the login password bound to the unique identifier based on the second modification information.
[0073] Optionally, after the first node logs in to the user's account, if the first node receives the user's logout operation, the first node can call the smart contract to broadcast the logout operation information to the blockchain network. In one example, the delete keyword can be used to delete all identity information corresponding to the unique identifier. In addition, it is also necessary to request the server to log out the login password and private key associated with the unique identifier.
[0074] All operations in the embodiments of the present invention interact with the underlying blockchain and generate corresponding hash values, which are recorded in the blockchain in the form of transactions. Figure 4 The following is an example of the process of an embodiment of the present invention. Figure 4 The following are explained:
[0075] After the smart contract is successfully deployed, only unregistered addresses can be registered, because one address can only register one account, that is, the address and account information correspond one to one. When registering, you need to fill in the user's address, which is a string of hash values. The registered fields include user role, user name and password. The user's registration operation is verified by each node on the blockchain network and finally stored in the distributed ledger in the form of a transaction.
[0076] Only registered accounts can log in, otherwise the system will prompt that it is not registered, because the unregistered address does not store any matching identity information in the distributed ledger, so it cannot log in. Similarly, the login operation will also interact with the smart contract to generate transaction credentials, record them in a new block, and broadcast them to other nodes in the entire network, and synchronize them to the ledgers of all nodes.
[0077] Users who have registered and successfully logged in can modify their personal account information, but only the username and password can be modified. The user address is the unique identifier of the user in the blockchain and cannot be modified. Modifying information requires interaction with the smart contract, so after the modification operation is successfully executed, a string of hash value transaction vouchers will be generated, recorded in the new block, and broadcast to other nodes in the entire network, and synchronized to the ledgers of all nodes.
[0078] When an account is registered and logged into the homepage, the account cancellation operation can be performed. This operation will also interact with the smart contract. In the smart contract, the delete keyword is used to delete all identity information corresponding to the current address. If the above operation is successful, a transaction certificate will be generated, added to a new block, and broadcast to the entire network through the P2P network, and synchronized to the ledgers of all nodes.
[0079] In an embodiment of the present invention, a user's registration operation is received by a first node, and the information of the registration operation includes the user's identity information and login password; the first node calls a smart contract pre-deployed in the blockchain network to generate a pair of public keys and private keys, and a unique identifier of the user; the first node binds the public key to the user's identity information to generate registration information; the first node broadcasts the registration information to the blockchain network to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; the first node binds the private key, the unique identifier and the login password, and stores them in the server. The private key and the login password can be bound and stored, and the public key can be stored through the blockchain network, so as to avoid the disclosure of the login password and prevent the leakage of the login password. At the same time, the characteristics of blockchain technology can be used to verify the private key bound to the login password through the publicly stored public key to prevent the login password from being tampered with, thereby improving the security of the user's identity authentication information.
[0080] The present invention also provides a data processing device based on blockchain, as described in the following embodiments. Since the problem and principle solved by the device are similar to the data processing method based on blockchain provided in the embodiment of the present invention, the implementation of the device can refer to the implementation of the data processing method based on blockchain, and the repeated parts will not be repeated.
[0081] Figure 5 Schematic diagram of a data processing device based on blockchain provided in an embodiment of the present invention. Figure 5 As shown, the device includes a first receiving unit 501, a first generating unit 502, a second generating unit 503, a first broadcasting unit 504 and a binding unit 505.
[0082] The first receiving unit 501 is used to receive the user's registration operation through the first node, and the information of the registration operation includes the user's identity information and login password; the first generating unit 502 is used to call the smart contract pre-deployed in the blockchain network through the first node to generate a pair of public keys and private keys, and the user's unique identifier; the second generating unit 503 is used to bind the public key with the user's identity information through the first node to generate registration information; the first broadcasting unit 504 is used to broadcast the registration information to the blockchain network through the first node, so as to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; the binding unit 505 is used to bind the private key, the unique identifier and the login password through the first node, and store them in the server.
[0083] Optionally, the device may also include: a second receiving unit, which is used to receive the user's login operation through the first node after the first node binds the private key, the unique identifier and the login password and stores them in the server; wherein the login operation includes inputting the unique identifier and the login password; a sending unit, which is used to call the smart contract through the first node and send a request to the server to verify the login operation; wherein the request carries the unique identifier and the login password; a third receiving unit, which is used to receive the private key corresponding to the unique identifier returned by the server through the first node when the server determines that the login password corresponding to the unique identifier is the same as the login password input for the login operation; a third generating unit, which is used to sign the information of the login operation based on the private key through the first node to generate a digital signature; a second broadcasting unit, which is used to broadcast the information of the login operation and the digital signature to the blockchain network through the first node, so that other nodes in the blockchain network verify the digital signature according to the public key stored in the account book maintained by themselves; a login unit, which is used to log in to the user's account through the first node after the first node receives the message of successful verification returned by more than a preset number of nodes; a third broadcasting unit, which is used to call the smart contract through the first node to generate login information, and broadcast the login information to the blockchain network.
[0084] Optionally, the device may also include: a fourth receiving unit, used for the first node to receive the user's modification operation after the first node logs in to the user's account; a fourth broadcasting unit, used for, when the modification operation includes modifying the user's identity information, calling the smart contract through the first node to generate first modification information according to the modification operation, and broadcasting the first modification information to the blockchain network; an execution unit, used for, when the modification operation includes modifying the user's login password, the first node calling the smart contract to generate second modification information according to the modification operation, and sending a modification request to the server, so that the server modifies the login password bound to the unique identifier based on the second modification information.
[0085] Optionally, the device may also include: a fifth receiving unit, used to receive the user's logout operation through the first node after the first node logs in to the user's account; a fifth broadcasting unit, used to call the smart contract through the first node, broadcast the information of the logout operation to the blockchain network, and request the server to log out the login password and private key associated with the unique identifier.
[0086] In an embodiment of the present invention, a user's registration operation is received by a first node, and the information of the registration operation includes the user's identity information and login password; the first node calls a smart contract pre-deployed in the blockchain network to generate a pair of public keys and private keys, and a unique identifier of the user; the first node binds the public key to the user's identity information to generate registration information; the first node broadcasts the registration information to the blockchain network to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; the first node binds the private key, the unique identifier and the login password, and stores them in the server. The private key and the login password can be bound and stored, and the public key can be stored through the blockchain network, so as to avoid the disclosure of the login password and prevent the leakage of the login password. At the same time, the characteristics of blockchain technology can be used to verify the private key bound to the login password through the publicly stored public key to prevent the login password from being tampered with, thereby improving the security of the user's identity authentication information.
[0087] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned blockchain-based data processing method when executing the computer program.
[0088] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned blockchain-based data processing method is implemented.
[0089] An embodiment of the present invention also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned blockchain-based data processing method is implemented.
[0090] In an embodiment of the present invention, a user's registration operation is received by a first node, and the information of the registration operation includes the user's identity information and login password; the first node calls a smart contract pre-deployed in the blockchain network to generate a pair of public keys and private keys, and a unique identifier of the user; the first node binds the public key to the user's identity information to generate registration information; the first node broadcasts the registration information to the blockchain network to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; the first node binds the private key, the unique identifier and the login password, and stores them in the server. The private key and the login password can be bound and stored, and the public key can be stored through the blockchain network, so as to avoid the disclosure of the login password and prevent the leakage of the login password. At the same time, the characteristics of blockchain technology can be used to verify the private key bound to the login password through the publicly stored public key to prevent the login password from being tampered with, thereby improving the security of the user's identity authentication information.
[0091] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0092] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0093] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0094] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0095] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A data processing method based on blockchain, characterized in that: include: The first node receives a registration operation of a user, wherein information of the registration operation includes identity information and a login password of the user; The first node calls a smart contract pre-deployed in the blockchain network to generate a pair of public and private keys and a unique identifier of the user; The first node binds the public key with the identity information of the user to generate registration information; The first node broadcasts the registration information to the blockchain network, so as to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; The first node binds the private key, the unique identifier and the login password, and stores them in the server; Wherein, after the first node binds the private key, the unique identifier and the login password and stores them in the server, the method further includes: The first node receives a login operation of the user; wherein the login operation includes inputting the unique identifier and the login password; The first node calls the smart contract and sends a request to the server to verify the login operation; wherein the request carries the unique identifier and the login password; When the server determines that the login password corresponding to the unique identifier is the same as the login password input in the login operation, the first node receives the private key corresponding to the unique identifier returned by the server; The first node signs the information of the login operation based on the private key to generate a digital signature; The first node broadcasts the information of the login operation and the digital signature to the blockchain network, so that other nodes in the blockchain network verify the digital signature according to the public key stored in the account book maintained by themselves; After the first node receives signature verification success messages returned by more than a preset number of nodes, the first node logs in to the user's account; The first node calls the smart contract to generate login information, and broadcasts the login information to the blockchain network.
2. The method according to claim 1, characterized in that After the first node logs into the user's account, the method further includes: The first node receives a modification operation by the user; In the case where the modification operation includes modifying the identity information of the user, the first node calls the smart contract to generate first modification information according to the modification operation, and broadcasts the first modification information to the blockchain network; In the case where the modification operation includes modifying the user's login password, the first node calls the smart contract to generate second modification information according to the modification operation, and sends a modification request to the server, so that the server modifies the login password bound to the unique identifier based on the second modification information.
3. The method according to claim 1, characterized in that After the first node logs into the user's account, the method further includes: The first node receives a logout operation of the user; The first node calls the smart contract, broadcasts information of the deregistration operation to the blockchain network, and requests the server to deregister the login password and private key associated with the unique identifier.
4. A data processing device based on blockchain, characterized in that: include: A first receiving unit, configured to receive a registration operation of a user through a first node, wherein information of the registration operation includes identity information and a login password of the user; A first generating unit, configured to call a smart contract pre-deployed in the blockchain network through the first node to generate a pair of public keys and private keys, and a unique identifier of the user; A second generating unit, configured to bind the public key to the identity information of the user through the first node to generate registration information; A first broadcasting unit, configured to broadcast the registration information to the blockchain network through the first node, so as to synchronously store the registration information in the ledgers maintained by all nodes in the blockchain network; a binding unit, configured to bind the private key, the unique identifier and the login password through the first node, and store them in a server; Wherein, the device further comprises: a second receiving unit, configured to receive a login operation of the user through the first node after the first node binds the private key, the unique identifier and the login password and stores them in the server; wherein the login operation includes inputting the unique identifier and the login password; A sending unit, configured to call the smart contract through the first node and send a request for verifying the login operation to the server; wherein the request carries the unique identifier and the login password; a third receiving unit, configured to receive, through the first node, a private key corresponding to the unique identifier returned by the server when the server determines that the login password corresponding to the unique identifier is the same as the login password input for the login operation; A third generating unit, configured to sign the information of the login operation based on the private key through the first node to generate a digital signature; A second broadcasting unit, configured to broadcast the information of the login operation and the digital signature to the blockchain network through the first node, so that other nodes in the blockchain network verify the digital signature according to the public key stored in the account book maintained by themselves; A login unit, configured to log in to the user's account through the first node after the first node receives signature verification success messages returned by more than a preset number of nodes; A third broadcasting unit is used to call the smart contract through the first node to generate login information, and broadcast the login information to the blockchain network.
5. The device according to claim 4, characterized in that The device also includes: A fourth receiving unit, configured to receive, by the first node, a modification operation of the user after the first node logs into the account of the user; A fourth broadcasting unit, configured to, when the modification operation includes modifying the identity information of the user, call the smart contract through the first node to generate first modification information according to the modification operation, and broadcast the first modification information to the blockchain network; An execution unit is used for, when the modification operation includes modifying the login password of the user, the first node calls the smart contract to generate second modification information according to the modification operation, and sends a modification request to the server, so that the server modifies the login password bound to the unique identifier based on the second modification information.
6. The device according to claim 4, characterized in that The device also includes: A fifth receiving unit, configured to receive a logout operation of the user through the first node after the first node logs into the account of the user; The fifth broadcast unit is used to call the smart contract through the first node, broadcast the information of the deregistration operation to the blockchain network, and request the server to deregister the login password and private key associated with the unique identifier.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
