Method, device, blockchain network and storage medium for controlling data access

By collaborating with the client and cryptographic devices, a second key is generated by signing the first public and private key pair of the blockchain network. This solves the problem of insufficient security in existing two-layer key generation methods, achieving high randomness and high security in key generation, and is suitable for data access in blockchain extended networks.

CN116781311BActive Publication Date: 2026-04-07CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-01
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing two-layer key generation methods mainly rely on human brain cryptography or Ethereum private keys, resulting in low randomness of key pairs, making them easy to crack and lacking in security.

Method used

Through collaboration between the client and the cryptographic device, the first key and identification information are signed using the private key of the first public-private key pair of the blockchain network, generating a second key as the root key of the blockchain network extension network. Combined with the parameter information of the current blockchain, the randomness and security of the signature data are improved.

Benefits of technology

It improves the randomness and security of the generated key pairs, prevents keys from being cracked, adapts to various application scenarios, and ensures the security of data access in the blockchain extension network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116781311B_ABST
    Figure CN116781311B_ABST
Patent Text Reader

Abstract

The application discloses a data access control method, device, blockchain network and storage medium. The method comprises: a client initiates a registration request to a password device, the registration request comprising identification information; receiving signature data and a first key, wherein the signature data is obtained by the password device signing the first key and the identification information based on a private key of a first public-private key pair of a blockchain network, and the first key is an access password of the password device; generating a second key based on the signature data, the second key being a root key for generating a second public-private key pair, and the second public-private key pair being a key of an extended network of the blockchain network. In this way, the access password and the client identification information are signed by the private key of the first public-private key pair of the blockchain network to obtain the signature data, which has high randomness and high security, thereby providing a security guarantee for subsequently generating the root key of the key pair of the extended network of the blockchain network.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information security, and particularly relates to a data access control method and device, a blockchain network and a storage medium. BACKGROUND

[0002] A blockchain is a decentralized computing and storage architecture, and is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism and encryption algorithm, and has been widely used in many fields. Ethereum is the most popular smart contract blockchain, and a large number of nodes participate in accounting and the transaction volume is large, which causes the transaction processing speed of Ethereum to be slow. In order to improve the transaction rate, Ethereum can be expanded. The Ethereum Layer 2 expansion scheme refers to an expansion scheme outside the Ethereum blockchain. At present, the Ethereum Layer 2 expansion scheme mainly adopts the ZK-rollup scheme, wherein ZK-rollup refers to using zero-knowledge proof to provide anonymity for Layer 2, and has compression while protecting the data privacy of Layer 2. ZK (Zero-Knowledge) means zero knowledge. Specifically, the transaction data of ZK-rollup Layer 2 is returned to Layer 1 after compression.

[0003] In the related art, in order to ensure security, ZK-rollup generates a Layer 2 key pair in addition to the Ethereum key pair. The existing Layer 2 key generation method mainly adopts the method of generating a Layer 2 key pair by using a brain wallet. Specifically, the brain wallet refers to a user generating a set of words in the style of a mnemonic word, and memorizing the set of words by the user's brain, and generating a Layer 2 key pair based on several words provided by the user. However, the randomness of the brain wallet completely comes from the human brain, and the capacity of the human brain is limited, so the randomness of the brain password is not high, which may cause the generated key pair to be cracked by brute force, and the security of the data is low. SUMMARY

[0004] Therefore, the embodiments of the present application provide a data access control method and device, a blockchain network and a storage medium, which aim to improve the security of data access.

[0005] The technical scheme of the embodiments of the present application is as follows:

[0006] In a first aspect, the embodiments of the present application provide a data access control method applied to a client, and the method comprises the following steps.

[0007] Initiating a registration request to a password device, wherein the registration request comprises identification information;

[0008] receive signature data and a first key, wherein the signature data is signed by the cryptographic device based on a private key of a first public-private key pair of a blockchain network, the first key being an access password of the cryptographic device;

[0009] generate a second key based on the signature data, the second key being a root key for generating a second public-private key pair, the second public-private key pair being a key of an extended network of the blockchain network.

[0010] In the above solution, the generating the second key based on the signature data comprises:

[0011] obtaining parameter information of a current blockchain, the parameter information comprising a block hash and / or a block height of the current blockchain;

[0012] generating the second key based on the signature data.

[0013] In the above solution, the method further comprises:

[0014] Before the generating the second key based on the signature data, the method comprises:

[0015] obtaining an address of the cryptographic device;

[0016] verifying the signature data based on the first key and the address of the cryptographic device;

[0017] if the verification is successful, generating the second key based on the signature data.

[0018] In the above solution, the method further comprises:

[0019] forming a mapping relationship between a public key of the second public-private key pair and the address of the cryptographic device;

[0020] sending a binding request to the blockchain network, the binding request comprising the mapping relationship between the public key of the second public-private key pair and the address of the cryptographic device.

[0021] In the above solution, the method further comprises:

[0022] sending an access request of the extended network of the blockchain network;

[0023] signing the access request based on a private key of the second public-private key pair.

[0024] In a second aspect, an embodiment of the present application provides a data access control method, applied to a cryptographic device, the method comprising:

[0025] receiving a registration request sent by a client, the registration request comprising identification information;

[0026] generate signature data based on a private key of a first public-private key pair of a blockchain network, the first key being an access password of the cryptographic device, and the signature data being used for generating a second key, the second key being a root key for generating a second public-private key pair, the second public-private key pair being a key of an extended network of the blockchain network.

[0027] send the signature data and the first key to the client, the signature data being used for generating a second key, the second key being a root key for generating a second public-private key pair, the second public-private key pair being a key of an extended network of the blockchain network.

[0028] In the above scheme, the method further comprises:

[0029] send an address of the cryptographic device to the client, the address of the cryptographic device and the first key being used by the client to verify the signature data.

[0030] In a third aspect, an embodiment of the present application provides a data access control apparatus, applied to a client, comprising:

[0031] a sending module, configured to initiate a registration request to a cryptographic device, the registration request comprising identification information;

[0032] a receiving module, configured to receive signature data and a first key, wherein the signature data is obtained by signing the first key and the identification information based on a private key of a first public-private key pair of a blockchain network, and the first key is an access password of the cryptographic device;

[0033] In a fourth aspect, an embodiment of the present application provides a data access control apparatus, applied to a cryptographic device, comprising:

[0034] a second receiving module, configured to receive a registration request sent by a client, the registration request comprising identification information;

[0035] a second generating module, configured to generate signature data based on a private key of a first public-private key pair of a blockchain network, the first key being an access password of the cryptographic device, and the signature data being used for generating a second key, the second key being a root key for generating a second public-private key pair, the second public-private key pair being a key of an extended network of the blockchain network.

[0036] a second sending module, configured to send the signature data and the first key to the client, the signature data being used for generating a second key, the second key being a root key for generating a second public-private key pair, the second public-private key pair being a key of an extended network of the blockchain network.

[0037] In a fifth aspect, an embodiment of the present application provides a client, comprising a processor and a memory for storing a computer program capable of running on the processor, wherein the computer program comprises:

[0038] The processor is configured to execute the computer program to perform the steps of the method of the first aspect.

[0039] In a sixth aspect, an embodiment of the present application provides a cryptographic device, comprising: a processor and a memory configured to store a computer program capable of running on the processor, wherein,

[0040] The processor is configured to execute the computer program to perform the steps of the method of the second aspect.

[0041] In a seventh aspect, an embodiment of the present application provides a blockchain network, comprising the client of the fifth aspect and the cryptographic device of the sixth aspect.

[0042] In an eighth aspect, an embodiment of the present application provides a computer storage medium, and the computer storage medium stores a computer program, and the computer program is configured to perform the steps of the method of any aspect of the present application when executed by a processor.

[0043] The technical scheme provided by the embodiment of the present application is applied to a client, the client initiates a registration request to a cryptographic device, the registration request comprises identification information; receives signature data and a first key, wherein the signature data is obtained by signing the first key and the identification information based on a private key of a first public-private key pair of a blockchain network, and the first key is an access password of the cryptographic device; a second key is generated based on the signature data, and the second key is a root key used to generate a second public-private key pair, and the second public-private key pair is a key of an extended network of the blockchain network. In this way, the signature data is generated by the node identification information, which can distinguish different applications and adapt to various application scenarios. Meanwhile, the signature data is obtained by signing the access password and the client identification information based on the private key of the first public-private key pair of the blockchain network, and the signature data has high randomness and high security, which provides security guarantee for generating the root key of the key pair of the extended network of the blockchain network. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 A flowchart of a data access control method provided by an embodiment of the present application is shown;

[0045] Figure 2 A flowchart of a data access control method provided by another embodiment of the present application is shown;

[0046] Figure 3 A system architecture and a flowchart of a data access control method for Ethereum in an application example of the present application are shown;

[0047] Figure 4 A structure diagram of a data access control device provided by an embodiment of the present application is shown;

[0048] Figure 5 A structural schematic diagram of a data access control device provided for another embodiment of the present application is shown in FIG. 4;

[0049] Figure 6 A structural schematic diagram of a client provided for an embodiment of the present application is shown in FIG. 5;

[0050] Figure 7 A structural schematic diagram of a cryptographic device provided for an embodiment of the present application is shown in FIG. 6. DETAILED DESCRIPTION

[0051] The present application will be further described in detail below with reference to the accompanying drawings and embodiments.

[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application.

[0053] In the related art, there are mainly two methods for generating a two-layer key:

[0054] Scheme one: brain wallet

[0055] A brain wallet is a way of generating a two-layer key by using a brain password and adding other parameters as a key seed. For example, a decentralized exchange (Loopring) uses a brain password, an Ethereum address, and a string to generate a key seed seed, and generates an EdDSA (Elliptic Curve Digital Signature Algorithm) key through the key seed seed. This scheme is considered to be a Loopring front-end bug due to the insufficient security of the brain password, and has been rectified.

[0056] Scheme two: generating a two-layer key using an Ethereum private key

[0057] The Ethereum private key is used to sign the corresponding content, and the signed result is used as a key seed to generate a two-layer key pair. Users of an Ethereum Layer-2 layer Dapp generally already have an Ethereum private key. This scheme ingeniously uses the Ethereum private key, which provides very good randomness through Ethereum private key signing. Using the Ethereum private key signature as a key seed to generate a two-layer key improves the security of the two-layer key, and users do not need to remember a password. If the two-layer key is lost, it can be re-derived using the Ethereum private key.

[0058] The above schemes have the following disadvantages:

[0059] The main disadvantage of Scheme One is that the human brain has limited capacity, so the randomness of the brain password is not high. Moreover, the Ethereum address used to generate the key seed and the fixed string are all public, so hackers can crack the private key through brute force. Brain wallet has been proven to be an insecure key. The cryptocurrency industry is a rampant industry of theft. Someone once conducted an experiment by putting $1 of Ethereum into a new, previously unused weak private key address, which was emptied within a few seconds.

[0060] Scheme Two generates EdDSA account private keys by hashing Ethereum signatures as key seeds, greatly improving the reliability of the second-layer key pair. The improved scheme of Loopring is as follows:

[0061] 1. For each Ethereum address, the relay counts the number of times the account key is updated since registration as the key count n. It will increase by 1 after each successful update of the account key.

[0062] 2. The exchange web page appends n to the end of the constant string: "Sign this message to access Loopring Exchange: 0x944644Ea989Ec64c2Ab9eF341D383cEf586A5777 with key nonce:". It includes the contract address of the exchange, and the new string is denoted by M. The exchange web page requests the user to sign M using its Ethereum ECDSA private key, thereby obtaining S, and then verifies S according to the user's Ethereum address A.

[0063] 3. The exchange web page generates an EdDSA account private key K using s = sha256(S) as the key seed.

[0064] 4. The exchange web page saves K in plain text format in the browser's session storage. It will be deleted once the session expires or the user logs out.

[0065] 5. When the user logs in, the exchange web page queries the key count from the relay to construct M for the user to sign.

[0066] Users who generally use Ethereum Layer-2 Dapps already have Ethereum private keys. This scheme cleverly uses the Ethereum private key, which provides good randomness through Ethereum private key signature. Using the Ethereum private key signature as a key seed to generate a second-layer key improves the security of the second-layer key. At the same time, users do not need to remember passwords, and if the second-layer key is lost, it can be derived again using the Ethereum private key.

[0067] The second scheme greatly improves the reliability of the two-layer key pair by hashing the Ethereum signature as a key seed to generate an EdDSA account private key. However, the second scheme also has two disadvantages:

[0068] One is that only the Ethereum private key is used as a security guarantee without a human brain password guarantee, and the security is reduced. Although the human brain password cannot resist hackers, it can prevent ordinary people around. If there is no human brain password at all, when the Ethereum private key is stolen, the two-layer key can also be directly derived, causing loss;

[0069] Two is that the scheme uses the nonce value as one of the parameters for generating the key seed, which has two problems: 1) it needs to rely on the relay counter; 2) one Ethereum address cannot have multiple accounts at the same time, and can only update the account, and the flexibility is not high.

[0070] Embodiments of the present application provide a data access control method, which is applied to a client, as shown in the following schematic diagram, the method mainly includes the following steps: Figure 1

[0071] Step 110: initiate a registration request to a password device, the registration request including identification information.

[0072] Here, the identification information sent by the client is used to identify the client, and different clients correspond to different identification information, which includes but is not limited to at least one of the following: application name of the client and account information of the user.

[0073] Here, the client can be different application terminals on the blockchain network. Taking Ethereum as an example, the client can be a terminal of a decentralized application (Dapp) deployed by Ethereum.

[0074] Step 120: receive signature data and a first key, wherein the signature data is signed by the private key of the first public-private key pair of the blockchain network based on the first key and the identification information, and the first key is the access password of the password device.

[0075] ​Here, the client receives the signature data and the first key sent from the cryptographic device. The signature data is signed by the private key of the first public-private key pair of the blockchain network based on the first key and the identification information. The blockchain network here can be the main chain of the blockchain. According to whether the blockchain can be independent enough, the blockchain can be divided into the main chain and the side chain. The blockchain main chain is the officially online and independent blockchain network, which is the trusted blockchain network recognized by the blockchain community, and the transaction information is recognized by all members, and the effective block is added to the blockchain ledger of the main network after the consensus of the blockchain network. Common blockchain main chains include Bitcoin, Ethereum, ADA and EOS.

[0076] Here, the signature data is signed by the private key of the first public-private key pair of the blockchain network based on the first key and the identification information. Taking Ethereum as an example, the first public-private key pair is (Kpub1, Kpri1) on Ethereum, and the signature data is signed by the private key Kpri1 of Ethereum on the first key and the identification information.

[0077] Step 130: generating a second key based on the signature data, the second key being a root key for generating a second public-private key pair, the second public-private key pair being a key of an extended network of the blockchain network.

[0078] Here, the client generates a second key based on the signature data, the second key being a root key for generating a second public-private key pair, the second public-private key pair being a key of an extended network of the blockchain network. For example, taking Ethereum as an example, the extended network of the blockchain network can be a side chain corresponding to Ethereum, i.e. a two-layer blockchain, and the second public-private key pair is (Kpub2, Kpri2), which is generated based on the second key.

[0079] Here, the second key is a root key for generating the second public-private key pair (Kpub2, Kpri2), and the second public-private key pair can be generated based on the second key and an encryption algorithm. The encryption algorithm includes but is not limited to Elliptic Curve Digital Signature Algorithm (ECDSA) and Edwards Curve Digital Signature Algorithm (EdDSA).

[0080] In the embodiments of the present application, the signature data is generated by the node identification information, which can distinguish different applications and adapt to various application scenarios. At the same time, the signature data is signed by the private key of the first public-private key pair of the blockchain network based on the cryptographic access and the client identification information, which has high randomness and high security, and provides security guarantee for the subsequent generation of the root key of the key pair of the extended network of the blockchain network.

[0081] In some embodiments, the generating the second key based on the signature data comprises:

[0082] Obtaining parameter information of the current blockchain, the parameter information comprising a block hash and / or a block height of the current blockchain;

[0083] Generating the second key based on the signature data.

[0084] Here, the hash value of the block (BlockHash) is the primary identifier of the block, which can also be referred to as the block header hash value, and is used to uniquely and explicitly identify a block. The block hash value is calculated by each node when the block is received from the network, and in the blockchain network, it contains all the blocks from the initial block, which contain all the transaction history records, making the integrity of the blockchain complete, and can be used for verification of blocks and transactions.

[0085] Here, the block height (BlockHeight) is the position of the block in the blockchain. A single block always has a clear and fixed block height, but unlike the block hash, the block height is not uniquely determined. A block height does not always identify a single block, and there can be two or more blocks that may have the same block height and compete for the same position in the blockchain.

[0086] By generating the signature data based on the block hash and / or the block height in the current blockchain, the block height and the block hash of the current Ethereum block at the time of generating the second public-private key pair are included in the parameters of the second key, ensuring that the same Ethereum address will not generate duplicate second keys in different applications, thereby improving the security of key generation.

[0087] In some embodiments, the method further comprises:

[0088] Before the generating the second key based on the signature data, the method comprises:

[0089] Obtaining the address of the cryptographic device;

[0090] Verifying the signature data based on the first key and the address of the cryptographic device;

[0091] If the verification is successful, generating the second key based on the signature data.

[0092] Here, before generating the second key based on the signature data, in order to ensure that the signature is initiated by the user, the signature also needs to be authenticated, that is, the signature is verified. After successful verification, the second key, that is, the root key, can be generated.

[0093] Exemplarily, the signature data can be parsed based on a parsing algorithm, information in the signature data and the private key are obtained, and a public key corresponding to the private key is checked. An address is calculated through the public key, and it is checked whether the address is consistent with the address of the cryptographic device. If consistent, the signature is valid.

[0094] In this way, by verifying the validity of the signature before generating the second key, the second key is generated only when the verification is valid, the accuracy of the signature data is improved, and higher security is provided for the generation of the second key.

[0095] In some embodiments, the method further comprises:

[0096] mapping the public key of the second public-private key pair with the cryptographic device address;

[0097] sending a binding request to the blockchain network, the binding request comprising the mapping relationship between the public key of the second public-private key pair and the cryptographic device address.

[0098] Here, after generating the second key pair based on the second key, the second key pair is the key of the expansion network of the blockchain network. When the blockchain expansion network performs data transmission related to the blockchain network, in order to be able to identify and authenticate the authenticity and security of the data transmission, the public key of the second public-private key pair is mapped with the address of the cryptographic device, and a binding request is sent to the blockchain network, so that the blockchain network can authenticate based on the mapping relationship between the public key of the expansion network and the address based on which it is sent when receiving the request of the expansion network, and perform the next operation after successful authentication.

[0099] In some embodiments, the method further comprises:

[0100] sending an access request of the expansion network of the blockchain network;

[0101] signing the access request based on the private key of the second public-private key pair.

[0102] Here, after generating the second public-private key pair, the client can use the private key of the public-private key pair as an operation password, send an access request to the expansion network of the blockchain, and sign the access request with the private key. All operations on the blockchain expansion network can be signed with the private key. In this way, when performing related operations of the blockchain expansion network, only the private key of the generated second public-private key pair needs to be signed, the second public-private key pair has high security and randomness, which improves the security guarantee when operating, and at the same time, the private key of the first public-private key pair does not need to be used to process related operations of the expansion network, which realizes risk isolation and protects the security of the private key of the first public-private key pair.

[0103] The embodiments of the present application also provide a method for controlling data access, which is applied to a cryptographic device, such as Figure 2 The method comprises the following steps:

[0104] Step 210: receiving a registration request sent by a client, wherein the registration request comprises identification information.

[0105] Here, the cryptographic device is used to provide a security protection mechanism to protect the security of key storage and access, including but not limited to a local Ethereum wallet, an external cryptographic device, a cryptographic machine or a U disk. The local Ethereum wallet can save and transfer currency, and can interact with an application program built on Ethereum through the wallet.

[0106] Step 220: generating signature data based on a private key of a first public-private key pair of a blockchain network, wherein the signature data is generated based on a first key and the identification information, and the first key is an access password of the cryptographic device.

[0107] Here, the first public-private key pair can be a key pair on a main chain in the blockchain network, which is used to ensure the security of data transmission in the blockchain network. For example, the first public-private key pair can be a public-private key pair (Kpub1, Kpri1) on Ethereum.

[0108] Here, the access password of the cryptographic device can also be the same in different applications. The access password of the cryptographic device can be an account password of a user, which is generally selected by the user as a password that has a meaning to the user and can be remembered, and is convenient to use and not easy to forget. However, due to the limited capacity of the human brain, the randomness is not high, and it is easy to be cracked. Here, the signature data is generated only by the first key.

[0109] Here, the private key of the first public-private key pair of the cryptographic device and the first key are stored in the cryptographic device. For example, in an Ethereum local wallet, Kpri1 of the first public-private key pair (Kpub1, Kpri1) on Ethereum is stored in the cryptographic device, and the first key is an access password of the cryptographic device, which can be set by the user. After receiving the identification information sent by the client, the Ethereum wallet signs the first key and the identification information based on Kpri1.

[0110] Step 230: sending the signature data and the first key to the client, wherein the signature data is used to generate a second key, the second key is a root key used to generate a second public-private key pair, and the second public-private key pair is a key of an extension network of the blockchain network.

[0111] Here, after the cryptographic device generates the signature data, the signature data is sent to the client, and the signature data is used by the client to generate the second key.

[0112] In the embodiments of the present application, the cryptographic device signs the first key and the identification information sent by the client based on the private key of the first public-private key pair of the blockchain network to obtain signature information used for generating the second key. The signature information is signed by the private key of the first public-private key pair, which improves the randomness of the signature data and further improves the security of the signature data by fusing the first key and the identification information. Meanwhile, the key generation with the addition of the identification information can also distinguish different applications so that the signature data can be applied to multiple scenarios.

[0113] In some embodiments, the method further comprises:

[0114] sending the address of the cryptographic device to the client, wherein the address of the cryptographic device and the first key are used by the client to verify the signature data.

[0115] Here, the address of the cryptographic device is stored in the cryptographic device. In order to ensure the authenticity and effectiveness of the signature data received by the client, the cryptographic device needs to send the address of the cryptographic device to the client, and the client verifies the signature data based on the received address of the cryptographic device and the first key. After verification, the second key can be generated based on the signature data.

[0116] Next, the embodiments of the present application will be described in further detail in conjunction with application examples. Taking Ethereum as an example, the data access control system architecture of the present application is shown in Figure 3 The system mainly includes a cryptographic device, an application client (Dapp), an Ethereum Layer-2 blockchain (Layer-2), and an Ethereum main chain (Ethereum). The cryptographic device is used to save the Ethereum private key and perform signature. In order to improve security, it can be an external cryptographic device, a cryptographic machine, or a U disk, or a local Ethereum wallet. The application client (Dapp) is a Dapp built based on the Ethereum Layer-2 protocol. A new key pair (such as EdDSA key) can be generated based on the Ethereum private key, which is used as the password of the Dapp. In all off-chain requests of the blockchain, this key pair can be used for signature. Ethereum Layer-2 is a two-layer blockchain of Ethereum, also known as Ethereum sidechain. It is used to improve transaction throughput and reduce transaction fees while ensuring the same security as Ethereum. At the same time, a rich application can also be built based on Ethereum Layer-2. Ethereum is the main chain of Ethereum, which guarantees the security of Ethereum Layer-2 layer and has a large number of secure and reliable nodes, which is the security cornerstone of the entire system. Based on the above system architecture, the above client is an application client (Dapp), the above cryptographic device is a local wallet, the above blockchain network is an Ethereum main chain, and the above blockchain expansion network is an Ethereum two-layer blockchain. As shown in Figure 3 The steps of the data access control method of the present application include:

[0117] Wherein, the first key is the user password passwd, the identification information is the application name (app_name) of the Dapp, and the second key is the key seed of the Ethereum Layer-2 key pair.

[0118] Step 301: The Dapp initiates a registration request (app_name).

[0119] The application client (Dapp) application initiates a registration request to the local wallet, and the registration request includes the application name (app_name). Here, different applications can be distinguished by different app_name, so as to adapt to different scenarios of applications.

[0120] Step 302: The local wallet generates a signature S.

[0121] After receiving the registration request, the local wallet generates a signature S by signing the user password passwd and the application name app_name with the private key (Kpri1) in the public-private key pair (Kpub1, Kpri1) on the Ethereum main chain, which is expressed as follows:

[0122] S = sign (app_name || password)

[0123] The Ethereum private key signature is used to ensure the randomness and security of the key seed, so the same user password can be used between different applications.

[0124] In the embodiments of the present application, the Ethereum signature with higher randomness is used to generate the key seed, which greatly improves the security of the signature. The key seed also includes the human brain password password, and the Layer-2 key pair is generated by combining the Ethereum private key and the human brain password, which double guarantees the security of the Layer-2 key.

[0125] Step 303: The local wallet sends S, passwd and address.

[0126] The local wallet sends the signature S, the user password passwd and the Ethereum address address to the Dapp application client. Here, the Ethereum address address is stored in the local wallet.

[0127] Step 304: The Dapp verifies the signature.

[0128] The application client (Dapp) verifies the signature S according to the received signature S, user password passwd and Ethereum address address, which is expressed as follows:

[0129] Verify(S, passwd, app_name, address) = true

[0130] Step 305: The Dapp generates a key seed seed.

[0131] After the signature verification is passed, the Dapp obtains the block hash and block height in the current block network, and then hashes the signature S, block hash blockHash and block height blockHeight to generate a key seed seed. In the generation process, the keccak algorithm can be used for hashing, which is represented as follows:

[0132] seed = keccakHash(S || blockHeight || blockHash)

[0133] In this way, the block height blockHeight and block hash blockHash are combined on the basis of the signature data, ensuring that the key pairs generated by different applications will not be repeated, thereby ensuring that the Ethereum Layer-2 key pairs generated based on the key seed will not be repeated, and ensuring their uniqueness.

[0134] Step 306: The Dapp generates an EdDSA key.

[0135] Based on the key seed seed, a high-security EdDSA key pair (public key Kpub2, private key Kpri2) is generated, which is represented as follows:

[0136] (Kpri2, Kpub2) = EdDSAGenerte(seed)

[0137] In this way, the Ethereum Layer-2 key pair generated by the above signature data combines the high randomness of Ethereum private key signature and the security of human brain password to generate a key seed with high randomness and high security. The derived Layer-2 key has the security provided by the Ethereum private key signature and the security provided by the human brain password. At the same time, the app_name parameter is added in the process of generating the Layer-2 key pair, which can distinguish different applications, making this scheme suitable for multiple application scenarios. Further, the parameters for generating the key seed include the Ethereum block height and block hash at the time of generating the Layer-2 key pair, ensuring that the same Ethereum address will not generate duplicate key pairs in different applications.

[0138] Step 307: The Dapp is bound on the chain.

[0139] The Dapp forms a mapping relationship between the public key Kpub2 generated in step 6 and the Ethereum address address, sends a binding request to the Ethereum main chain, and the binding request includes the mapping relationship. The Ethereum main chain anchors the mapping relationship, and the binding is completed. The mapping relationship is expressed as follows:

[0140] map (address, Kpub2)

[0141] In this way, the authenticity of the request of the Ethereum Layer-2 blockchain can be ensured, and the security of the transaction is improved.

[0142] Step 308: The Dapp uses the off-chain request to sign using the EdDSA key Kpri2.

[0143] The private key Kpri2 generated by the Dapp is the operation key of the Dapp, and all operations in the Dapp (except Ethereum chain operations) are signed using the private key. When the private key Kpri2 is lost, the Ethereum private key and the password can be used to derive it.

[0144] In this way, the signature data of the user password and the application identifier using the Ethereum private key is used as the key seed, and the Layer-2 key is generated based on the key seed. The randomness of the key seed is greatly enhanced, and the possibility of being brute-forced is greatly reduced. In addition, when generating the key seed, the current block height and block hash are integrated to ensure that the generated key is not repeated. The function of deriving countless key pairs from one Ethereum private key and one password is achieved, and the user only needs to remember a password and save an Ethereum private key. At the same time, the Layer-2 key pair is generally saved in the application cache, and when the cache is cleared, the Layer-2 key pair is derived again. The Ethereum private key in the embodiment is only used to generate the Layer-2 key pair, and the Ethereum private key will not be used in subsequent operations of the Dapp, which realizes risk isolation and greatly ensures the security of the Ethereum private key.

[0145] Based on the same inventive concept as the data access control method provided in the foregoing embodiments, the embodiments of the present application also provide a data access control device. The device is applied to a client, as shown in the following Figure 4 The data access control device 400 includes a first sending module 410, a first receiving module 420, and a first generating module 430.

[0146] The first sending module 410 is configured to send a registration request to a password device, and the registration request includes identification information.

[0147] The first receiving module 420 is configured to receive signature data and a first key, wherein the signature data is obtained by signing the first key and identification information by a private key of a first public-private key pair of a blockchain network based on the private key, and the first key is an access password of the cryptographic device.

[0148] The first generating module 430 is configured to generate a second key based on the signature data, wherein the second key is a root key used to generate a second public-private key pair, and the second public-private key pair is a key of an extended network of the blockchain network.

[0149] In some embodiments, the first generating module 430 is specifically configured to:

[0150] obtain parameter information of a current blockchain, wherein the parameter information comprises a block hash and / or a block height of the current blockchain;

[0151] generate the second key based on the signature data.

[0152] In some embodiments, the first receiving module 420 is further configured to:

[0153] receive an address of the cryptographic device.

[0154] In some embodiments, the data access control apparatus further comprises a verifying module 440,

[0155] configured to verify the signature data based on the first key and the address of the cryptographic device;

[0156] if the verification is successful, generate the second key based on the signature data.

[0157] In some embodiments, the first generating module 430 is further configured to:

[0158] form a mapping relationship between a public key of the second public-private key pair and the address of the cryptographic device.

[0159] In some embodiments, the first sending module is further configured to:

[0160] send a binding request to the blockchain network, wherein the binding request comprises the mapping relationship between the public key of the second public-private key pair and the address of the cryptographic device.

[0161] send an access request of an extended network of the blockchain network

[0162] In some embodiments, the data access control apparatus further comprises a signing apparatus 450,

[0163] configured to sign the access request based on a private key of the second public-private key pair.

[0164] In practical application, the first sending module 410, the first receiving module 420 and the first generating module 430 can be implemented by a processor in the data access control device. Of course, the processor needs to run a computer program in the memory to realize its functions.

[0165] The embodiment of the application further provides a data access control device, which is applied to a cryptographic device, such as Figure 5 As shown in the figure, the data access control device 500 includes a second receiving module 510, a second generating module 520 and a second sending module 530.

[0166] The second receiving module 510 is configured to receive a registration request sent by a client, the registration request including identification information.

[0167] The second generating module 520 is configured to generate signature data based on a private key of a first public-private key pair of a blockchain network, the signature data being generated based on a first key and the identification information, wherein the first key is an access password of the cryptographic device.

[0168] The second sending module 530 is configured to send the signature data and the first key to the client, the signature data being used to generate a second key, the second key being a root key used to generate a second public-private key pair, and the second public-private key pair being a key of an extended network of the blockchain network.

[0169] In some embodiments, the second sending module 530 is further configured to:

[0170] send an address of the cryptographic device to the client, the address of the cryptographic device and the first key being used by the client to verify the signature data.

[0171] In practical application, the second receiving module 510, the second generating module 520 and the second sending module 530 can be implemented by a processor in the data access control device 500. Of course, the processor needs to run a computer program in the memory to realize its functions.

[0172] It should be noted that the data access control device provided in the above embodiment is only used for example to illustrate the division of the above program modules, and in practical application, the above processes can be completed by different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the above processes. In addition, the data access control device and the data access control method provided in the above embodiment belong to the same concept, and the specific implementation process is described in the method embodiment, which will not be repeated here.

[0173] Based on the hardware implementation of the above program modules, and in order to realize the method of the embodiment of the application, the embodiment of the application further provides a client. Figure 6Only an exemplary structure of the client is shown, not all structures, and the implementation can be performed according to needs Figure 6 part of the structure or the whole structure is shown.

[0174] As shown in Figure 6 the client 600 provided by the embodiments of the present application includes at least one processor 601, a memory 602, a user interface 603 and at least one network interface 604. The various components in the client 600 are coupled together by a bus system 605. It can be understood that the bus system 605 is used to realize the connection communication between the components. The bus system 605 includes a data bus, a power bus, a control bus and a status signal bus in addition to the data bus. However, for the purpose of clear illustration, all the buses are marked as the bus system 605 in the Figure 6 .

[0175] The user interface 603 can include a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touchpad or a touch screen, etc.

[0176] The memory 602 in the embodiments of the present application is used to store various types of data to support the operation of the client. Examples of the data include any computer programs used for operation on the client.

[0177] The data access control method disclosed by the embodiments of the present application can be applied to the processor 601 or implemented by the processor 601. The processor 601 can be an integrated circuit chip with a signal processing capability. In the implementation process, the steps of the data access control method can be completed by the integrated logic circuits or the instructions in the form of software in the processor 601. The processor 601 described above can be a general purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The processor 601 can realize or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiments of the present application, the data access control method provided by the embodiments of the present application can be directly embodied as a hardware coding processor to execute, or be executed by a combination of hardware and software modules in the coding processor. The software module can be located in a storage medium, and the storage medium is located in the memory 602. The processor 601 reads the information in the memory 602, and combines the hardware to complete the steps of the data access control method provided by the embodiments of the present application.

[0178] In exemplary embodiments, a client can be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, microcontrollers (MCUs), microprocessors (Microprocessors), or other electronic elements for executing the aforementioned methods.

[0179] The embodiments of the present application further provide a cryptographic device, Figure 7 Only exemplary structures of the cryptographic device are shown, not all structures, and the cryptographic device can be implemented according to needs Figure 7 with part of the structures or all the structures shown.

[0180] As shown in Figure 7 the cryptographic device 700 provided by the embodiments of the present application comprises at least one processor 701, a memory 702, a user interface 703, and at least one network interface 704. The various components in the cryptographic device 700 are coupled together by a bus system 705. It can be understood that the bus system 705 is used to realize the connection communication between the components. The bus system 705 includes not only a data bus, but also a power bus, a control bus, and a status signal bus. However, for the purpose of clear illustration, all the buses are marked as the bus system 705 in Figure 7 .

[0181] The user interface 703 can include a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touchpad, or a touch screen, etc.

[0182] The memory 702 in the embodiments of the present application is used to store various types of data to support the operation of the cryptographic device. Examples of the data include any computer programs used for operating on the cryptographic device.

[0183] The data access control method disclosed by the embodiments of the present application can be applied to the processor 701 or implemented by the processor 701. The processor 701 can be an integrated circuit chip with a signal processing capability. In the implementation process, the steps of the data access control method can be completed by the integrated logic circuit or the software form of instructions in the processor 701. The processor 701 described above can be a general processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The processor 701 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiments of the present application, the hardware decoding processor can be directly embodied to execute the steps, or the hardware and software modules in the decoding processor can be combined to execute the steps. The software module can be located in a storage medium, and the storage medium is located in the memory 702. The processor 701 reads the information in the memory 702 and combines the hardware to complete the steps of the data access control method provided in the embodiments of the present application.

[0184] In exemplary embodiments, the cryptographic device can be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic elements for performing the aforementioned methods.

[0185] It can be appreciated that the memory 602, 702 can be a volatile memory or a nonvolatile memory, and can also include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a ferromagnetic random access memory (FRAM), a Flash Memory, a magnetic surface memory, an optical disc, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM can be used, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory described in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memory.

[0186] In the example embodiments, the embodiments of the present application also provide a storage medium, i.e., a computer storage medium, specifically a computer readable storage medium, for example, including the memory 602 storing a computer program, the computer program being executable by the processor 601 of the client to complete the steps of the method of the embodiments of the present application; or, for example, including the memory 702 storing a computer program, the computer program being executable by the processor 701 of the cryptographic device to complete the steps of the method of the embodiments of the present application. The computer readable storage medium can be a ROM, a PROM, an EPROM, an EEPROM, a Flash Memory, a magnetic surface memory, an optical disc, or a CD-ROM, etc.

[0187] It should be noted that "first", "second", etc. are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0188] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0189] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data access control method, characterized in that, Applied to a client, the method includes: A registration request is initiated to the cryptographic device, the registration request including identification information; Receive signature data and a first key, wherein the signature data is obtained by the cryptographic device signing the first key and the identification information with the private key of the first public-private key pair of the blockchain network, and the first key is the access password of the cryptographic device; A second key is generated based on the signature data. The second key is the root key used to generate a second public-private key pair, which is the key of the extended network of the blockchain network.

2. The method according to claim 1, characterized in that, The generation of the second key based on the signature data includes: Obtain parameter information of the current blockchain, including the block hash and / or block height of the current blockchain; The second key is generated based on the signature data.

3. The method according to claim 1, characterized in that, The method further includes: Before generating the second key based on the signature data, the method includes: Receive the address of the cryptographic device; The signature data is verified based on the first key and the address of the cryptographic device; If the verification is successful, a second key is generated based on the signature data.

4. The method according to claim 1, characterized in that, The method also includes A mapping relationship is formed between the public key of the second public-private key pair and the address of the cryptographic device; A binding request is sent to the blockchain network, the binding request including the mapping relationship between the public key of the second public-private key pair and the address of the cryptographic device.

5. The method according to claim 1, characterized in that, The method further includes: Send an access request to the extended network of the blockchain network; The access request is signed using the private key of the second public-private key pair.

6. A data access control method, characterized in that, Applied to cryptographic devices, the method includes: Receive a registration request sent by a client, the registration request including identification information; A signature is generated based on the first public and private keys of the blockchain network, using the first key and the identification information, wherein the first key is the access password for the cryptographic device; The signature data and the first key are sent to the client. The signature data is used to generate a second key, which is the root key for generating a second public-private key pair. The second public-private key pair is the key of the extended network of the blockchain network.

7. The method according to claim 6, characterized in that, The method further includes: The address of the cryptographic device is sent to the client, and the address of the cryptographic device and the first key are used by the client to verify the signature data.

8. A data access control device, characterized in that, Applied to the client side, including: The first sending module is used to send a registration request to the cryptographic device, the registration request including identification information; The first receiving module is used to receive signature data and a first key, wherein the signature data is obtained by the cryptographic device signing the first key and the identification information with the private key of the first public-private key pair of the blockchain network, and the first key is the access password of the cryptographic device; The first generation module is used to generate a second key based on the signature data. The second key is the root key used to generate a second public-private key pair, and the second public-private key pair is the key of the extended network of the blockchain network.

9. A data access control device, characterized in that, Applied to cryptographic devices, including: The second receiving module is used to receive a registration request sent by the client, the registration request including identification information; The second generation module is used to generate signature data based on the first public-private key pair of the blockchain network, the first key, and the identification information, wherein the first key is the access password of the cryptographic device; The second sending module is used to send the signature data and the first key to the client. The signature data is used to generate a second key, which is the root key for generating a second public-private key pair. The second public-private key pair is the key of the extended network of the blockchain network.

10. A client, characterized in that, include: The processor and memory for storing computer programs that can run on the processor, wherein, The processor, when running a computer program, performs the steps of the method according to any one of claims 1 to 5.

11. A cryptographic device, characterized in that, include: The processor and memory for storing computer programs that can run on the processor, wherein, The processor, when running a computer program, performs the steps of the method according to any one of claims 6 to 7.

12. A blockchain network, characterized in that, This includes the client as described in claim 10 and the cryptographic device as described in claim 11.

13. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Block chain side chain cross-chain identity credibility authentication and data encryption transmission method

    CN114598533A

  • Validating and storing V-model transaction records in a blockchain

    DE102020203861A1