WO2021057124A1 - Fpga-based privacy block chain implementing method and device - Google Patents

Fpga-based privacy block chain implementing method and device Download PDF

Info

Publication number
WO2021057124A1
WO2021057124A1 PCT/CN2020/097358 CN2020097358W WO2021057124A1 WO 2021057124 A1 WO2021057124 A1 WO 2021057124A1 CN 2020097358 W CN2020097358 W CN 2020097358W WO 2021057124 A1 WO2021057124 A1 WO 2021057124A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
configuration file
client
fpga structure
circuit logic
Prior art date
Application number
PCT/CN2020/097358
Other languages
French (fr)
Chinese (zh)
Inventor
魏长征
潘国振
闫莺
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021057124A1 publication Critical patent/WO2021057124A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a method and device for implementing a privacy blockchain based on FPGA.
  • Blockchain technology is built on a transmission network (such as a peer-to-peer network).
  • the network nodes in the transmission network use chained data structures to verify and store data, and use distributed node consensus algorithms to generate and update data.
  • TEE Trusted Execution Environment
  • TEE can play the role of a black box in the hardware. Neither the code executed in the TEE nor the data operating system layer can be peeped, and only the pre-defined interface in the code can operate on it.
  • plaintext data is calculated in TEE instead of complex cryptographic operations in homomorphic encryption. There is no loss of efficiency in the calculation process. Therefore, the combination with TEE can achieve less performance loss. Under the premise, the security and privacy of the blockchain are greatly improved. At present, the industry is very concerned about the TEE solution.
  • TEE solutions including TPM (Trusted Platform Module) in software and Intel SGX (Software Guard Extensions) in hardware. , Software Protection Extension), ARM Trustzone (trust zone) and AMD PSP (Platform Security Processor, platform security processor).
  • one or more embodiments of this specification provide a method and device for implementing a privacy blockchain based on FPGA.
  • a method for implementing a privacy blockchain based on FPGA which includes:
  • the client deploys a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment of the blockchain node;
  • the client receives the authentication result returned by the FPGA structure, the authentication result is signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key is made public;
  • the client confirms that the circuit logic configuration file is successfully deployed on the FPGA structure when the authentication result passes the signature verification and the authentication result includes content related to the circuit logic configuration file.
  • a method for implementing a privacy blockchain based on FPGA which includes:
  • the FPGA structure deploys a circuit logic configuration file from the client, and the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
  • the FPGA structure signs the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public key corresponding to the authentication root key is disclosed;
  • the FPGA structure returns the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes content related to the circuit logic configuration file In this case, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
  • a device for implementing a privacy blockchain based on FPGA including:
  • the configuration file deployment unit enables the client to deploy a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment for the blockchain node;
  • the authentication result receiving unit enables the client to receive the authentication result returned by the FPGA structure, the authentication result being signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key Be made public
  • a confirmation unit is deployed to enable the client to confirm that the circuit logic configuration file is on the FPGA structure when the authentication result passes the signature verification and the authentication result contains content related to the circuit logic configuration file The deployment was successful.
  • a device for implementing a privacy blockchain based on FPGA including:
  • the configuration file deployment unit enables the FPGA structure to deploy the circuit logic configuration file from the client, and the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
  • the authentication result signing unit causes the FPGA structure to sign the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public authentication root key corresponds to the authentication result. Key is made public;
  • the authentication result returning unit is configured to enable the FPGA structure to return the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes the circuit logic In the case of configuration file-related content, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor implements the method according to the first aspect by running the executable instruction.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor implements the method according to the second aspect by running the executable instruction.
  • a computer-readable storage medium is provided with computer instructions stored thereon, which when executed by a processor implements the steps of the method described in the second aspect.
  • Fig. 1 is a flowchart of a method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
  • Fig. 2 is a flowchart of another method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
  • Fig. 3 is a schematic flowchart of an interaction process between a client and an FPGA structure provided by an exemplary embodiment.
  • Fig. 4 is a schematic diagram of a blockchain node processing a transaction according to an exemplary embodiment.
  • Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Fig. 6 is a block diagram of a device for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
  • Fig. 7 is a schematic structural diagram of another device provided by an exemplary embodiment.
  • Fig. 8 is a block diagram of another device for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
  • the steps of the corresponding method are not necessarily executed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. description.
  • Block chains are generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain.
  • the public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks. Moreover, each participant (ie, node) can freely join and exit the network, and perform related operations.
  • the private chain is the opposite.
  • the write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization.
  • the private chain can be a weakly centralized system with strict restrictions and few participating nodes.
  • This type of blockchain is more suitable for internal use by specific institutions.
  • Consortium chain is a block chain between public chain and private chain, which can realize "partial decentralization".
  • Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain.
  • the nodes in the blockchain network may use a solution that combines the blockchain and the TEE (Trusted Execution Environment).
  • TEE Trusted Execution Environment
  • TEE is a secure extension based on CPU hardware and a trusted execution environment that is completely isolated from the outside.
  • TEE was first proposed by Global Platform to solve the security isolation of resources on mobile devices, and parallel to the operating system to provide a trusted and secure execution environment for applications.
  • ARM's Trust Zone technology is the first to realize the real commercial TEE technology. With the rapid development of the Internet, security requirements are getting higher and higher. Not only mobile devices, cloud devices, and data centers have put forward more demands on TEE.
  • TEE has also been rapidly developed and expanded. Compared with the originally proposed concept, the TEE referred to now is a more generalized TEE.
  • server chip manufacturers Intel and AMD have successively introduced hardware-assisted TEE and enriched the concepts and features of TEE, which has been widely recognized in the industry.
  • the TEE mentioned now usually refers more to this kind of hardware-assisted TEE technology.
  • SGX provides an enclave (also known as an enclave), which is an encrypted trusted execution area in the memory, and the CPU protects data from being stolen.
  • enclave also known as an enclave
  • the CPU protects data from being stolen.
  • a part of the area EPC Enclave Page Cache, enclave page cache or enclave page cache
  • the encryption engine MEE Memory Encryption Engine
  • the first step in using TEE is to confirm the authenticity of TEE.
  • a remote attestation mechanism is used to confirm whether the TEE is authentic and credible.
  • the circle to be verified first generates the configuration file deployed by itself as a Report, for example, the report can include the circle to be verified The hash value of the deployed configuration file, etc.; then, the enclave to be verified uses the local authentication mechanism to obtain the remote verifiable Quote.
  • a special enclave called Quoting Enclave (QE) on the target device can use the CPU of the target device
  • the deployed asymmetric key signs the aforementioned Report, thereby generating the aforementioned remotely verifiable Quote, and the target device sends the Quote to the challenger.
  • the above asymmetric keys are burned into the CPU during the production process.
  • the asymmetric keys burned in different CPUs are completely different, and the public key corresponding to each asymmetric key is uniformly maintained in IAS (Intel Attestation Server) Place. Therefore, the challenger needs to further send the Quote provided by the target device to the IAS, and the IAS will verify the signature contained in the Quote to determine the validity of the SGX platform on the target device and feed back the judgment result to the challenger.
  • IAS Intelligent Attestation Server
  • the challenger can further verify the Report contained in the Quote, for example, compare the hash value contained in the Report with the hash value corresponding to the standard configuration file held by the challenger : If the hash values are consistent, the challenger can determine that the standard configuration file is correctly configured in the circle to be verified of the target device, that is, the circle to be verified above has passed the remote certification.
  • the remote certification mechanism in related technologies can prove that the correct configuration file is deployed in the TEE, the operating environment on which the TEE itself depends cannot be verified; for example, on the blockchain nodes that need to implement privacy functions, A virtual machine for executing smart contracts needs to be configured in the TEE.
  • the instructions executed by the virtual machine are not directly executed, but actually execute a number of corresponding X86 instructions (assuming that the target device adopts the X86 architecture), which causes a certain degree of Security risks on the Internet.
  • the following describes a method for implementing a privacy blockchain based on FPGA provided in this specification in conjunction with embodiments to improve security.
  • Fig. 1 is a flowchart of a method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment. As shown in Figure 1, the method is applied to the client and can include the following steps:
  • Step 102 The client deploys a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment of the blockchain node.
  • the client can include any object that needs to implement deployment operations to the FPGA structure, so that the FPGA structure can implement corresponding services or functions based on the deployed circuit logic configuration file.
  • the client can include a key management server, that is, a KMS (Key Management Service) server.
  • KMS Key Management Service
  • the KMS server can assign the corresponding service key to the FPGA structure so that The FPGA structure can be implemented as a TEE on a blockchain node, thereby realizing a blockchain node with privacy functions.
  • the client deploys an appropriate circuit logic configuration file to the FPGA structure, so that the FPGA structure can be implemented as a TEE on the blockchain node after the circuit logic configuration file is correctly configured.
  • the circuit logic configuration file may include a virtual machine used to implement (taking the aforementioned Ethereum blockchain as an example, the virtual machine may be an Ethereum Virtual Machine (EVM); in other blockchains) It can also be the configuration information of other types of virtual machines), encryption and decryption functions. These configuration information can be specifically represented in the form of bitstreams to facilitate burning to the FPGA structure.
  • EVM Ethereum Virtual Machine
  • this specification does not limit the circuit logic configuration files used form.
  • the FPGA structure can be pre-deployed with an authentication root key (Attestation Key), the authentication root key can be pre-placed in the FPGA structure, or the authentication root key can be deployed to the FPGA in an offline secure environment by the client or other objects Structure.
  • the authentication root key is an asymmetric key, and the public key corresponding to the authentication root key is disclosed, so that even if the authentication root key is not deployed by the client (preset or deployed by other objects), the client The end can also verify the signature generated by the authentication root key based on the public key that is disclosed.
  • the client can realize key agreement with the FPGA structure.
  • the client and the FPGA structure need to implement at least one information exchange during the negotiation process: when the FPGA structure sends the negotiation information to the client, the above authentication root key can be used for the negotiation
  • the information is signed, so that the client can use the public key to perform signature verification after receiving the signed negotiation information, so as to confirm that the negotiation information is indeed sent by the FPGA structure and trust the negotiation information; and when the signature fails During verification, the client can choose not to trust the received negotiation information.
  • the client and FPGA structure can complete key negotiation, so that the client and FPGA structure can obtain the same configuration file deployment key respectively.
  • the configuration file deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the configuration file deployment key can be a secret value (or master key); or, the configuration file deployment key
  • the key can be derived from the above-mentioned secret value by the client and the FPGA structure respectively through the Key Derivation Function (KDF).
  • KDF Key Derivation Function
  • the client can encrypt the above-mentioned circuit logic configuration file and send the encrypted circuit logic configuration file to the FPGA structure; accordingly, the FPGA structure receives the encrypted circuit logic configuration file Later, the corresponding circuit logic configuration file can be obtained by decrypting according to the configuration file deployment key, and the circuit logic configuration file can be deployed.
  • the FPGA structure may include an FPGA chip, and when the FPGA structure deploys a circuit logic configuration file, the circuit logic configuration file can be directly read into the FPGA chip.
  • the FPGA chip is volatile, and the circuit logic configuration file deployed after the power is off will be lost, so that the client needs to re-deploy the circuit logic configuration file after power on.
  • the FPGA structure can further include a memory, which is connected to the FPGA chip, so that the circuit logic configuration file is deployed in the memory, and the FPGA chip reads the circuit logic configuration file from the memory to implement related functions ;
  • the memory is non-volatile, even if the power is off, the circuit logic configuration file can still be saved, and after the power is turned on, it is only necessary to read the FPGA chip from the memory again, without the client re-deployment.
  • the memory may have various forms, such as non-volatile memory that can be repeatedly erased and writable such as flash memory, and non-repeatable memory such as fuse memory, which is not limited in this specification.
  • the FPGA structure may include a key management chip, and the aforementioned authentication root key may be stored in the key management chip to have high security and high reliability.
  • the authentication root key can also be stored in the aforementioned FPGA chip or memory, which is not limited in this specification.
  • Step 104 The client receives the authentication result returned by the FPGA structure, the authentication result is signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key is made public.
  • Step 106 The client confirms that the circuit logic configuration file is successfully deployed on the FPGA structure when the authentication result passes the signature verification and the authentication result contains content related to the circuit logic configuration file .
  • the client can obtain the public key in advance and target the FPGA structure accordingly.
  • the returned authentication result is subjected to signature verification, and if the signature verification is passed, it is determined that the authentication result is provided by the FPGA structure and the authentication result has not been tampered with.
  • the above verification process can be completed locally by the client without the need of a third party. On the one hand, it can reduce the number of interactions and improve the efficiency of verification. On the other hand, it can avoid the intervention of third parties and the increase in the number of interactions that may cause additional security risks. To ensure the reliability of the verification results does not depend on the self-control and credibility of a third party.
  • the client can verify the content related to the circuit logic configuration file contained in the authentication result, so as to determine whether the content is consistent with the circuit logic configuration file deployed by the client to the FPGA structure.
  • the above-mentioned content related to the circuit logic configuration file may be the hash value of the circuit logic configuration file, or the value obtained by calculating the hash value of the circuit logic configuration file using a preset algorithm (such as sm3 algorithm, etc.), so that
  • the client has the above-mentioned circuit logic configuration file and the above-mentioned preset algorithm is known, it can calculate the hash value of the circuit logic configuration file locally or use the above-mentioned preset algorithm to further calculate the hash value, and verify it with The above-mentioned hash values or values contained in the result are compared: if they are consistent, it indicates that the FPGA structure correctly deploys the circuit logic configuration file provided by the client; otherwise, it indicates that the circuit logic configuration file is not configured successfully.
  • the aforementioned authentication result may also include content related to the deployment key of the configuration file.
  • the client can verify the above-mentioned authentication result according to the deployment key of the configuration file exported by itself.
  • the authentication result can include the hash value of the configuration file deployment key, or the value obtained by calculating the configuration file deployment key or its hash value using a preset algorithm, which is similar to the above-mentioned circuit logic configuration file.
  • the client can calculate the hash value or the value related to the above-mentioned preset algorithm according to the configuration file deployment key exported by itself: if the authentication result contains the content related to the circuit logic configuration file and the content related to the configuration file deployment key.
  • the content related to the circuit logic configuration file and the content related to the configuration file deployment key in the authentication result can be generated as the same content, that is, the authentication result can include a circuit logic configuration file and configuration file deployment key at the same time.
  • the FPGA structure can use a preset algorithm to calculate the deployed circuit logic configuration file (or its hash value) and the negotiated configuration file deployment key (or its hash value) to obtain a value .
  • the configuration file deployment key and the known above-mentioned preset algorithm according to its own maintenance namely The value contained in the certification result can be verified.
  • the client can negotiate a key with the FPGA structure, so that the client and FPGA structure can respectively export the same business secret deployment key to use the service provided by the client
  • the key or other business secrets are deployed to the FPGA structure.
  • the client and the FPGA structure need to send negotiation information to each other, and after the FPGA structure generates the negotiation information, it can sign with the aforementioned authentication root key, and send the signed negotiation information to the client
  • the client can perform signature verification according to the public key that has been disclosed: after the signature is verified, the client determines that the negotiation information comes from the FPGA structure, and further completes the negotiation process based on the negotiation information, otherwise the client can terminate the key negotiation.
  • the client and FPGA structure can obtain the same business secret deployment key after negotiation.
  • the business secret deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the business secret deployment key can be a secret value (or master key); or, the business secret deployment key
  • the key can be derived from the above-mentioned secret value through the key derivation function through the client and FPGA structure respectively.
  • the client can encrypt the business key that needs to be deployed and send the encrypted business key to the FPGA structure; accordingly, after the FPGA structure receives the encrypted business key,
  • the corresponding service key can be obtained by decryption according to the service secret deployment key, and the service key can be deployed.
  • the service key may include: the node private key, the node public key corresponding to the node private key is disclosed; where the node public key is used to encrypt the transaction, or the node public key is symmetrical with the transaction submitting party
  • the key is commonly used to encrypt transactions through digital envelopes.
  • the node can use the node's private key to decrypt in the FPGA structure to obtain the transaction content in plain text; or, the transaction submitting party can use a randomly generated (or obtained by other means) symmetric key to encrypt the transaction, and then pass through the above-mentioned node
  • the public key encrypts the symmetric key, and submits the encrypted transaction and the encrypted symmetric key to the blockchain node, and the blockchain node can use the node private key in the FPGA structure to decrypt the encrypted symmetric key , And decrypt the encrypted transaction with the symmetric key obtained by decryption, so as to obtain the transaction content in plain text.
  • the business key may include: the business root key, the business root key or the derived key of the business root key is used to encrypt the private data generated in the trusted execution environment and store it to the blockchain node Maintained in the database.
  • the above-mentioned private data with encryption requirements may be generated.
  • the private data may include the value of the contract state generated by the execution of the smart contract, then the FPGA structure may The private data is encrypted by the business root key or its derived key, and the encrypted private data is stored in the database maintained by the blockchain node.
  • the FPGA structure when the private data needs to be read, by reading the encrypted private data into the FPGA structure, the FPGA structure can be decrypted based on the business root key or its derivative key, and the corresponding plaintext can be obtained. Private data, so as to read or update the value of the private data, or use the value of the private data to participate in other calculation processes, etc.
  • the client and the FPGA structure can negotiate to obtain the above-mentioned configuration file deployment key and business secret deployment key through two negotiation processes. Or, the client and the FPGA structure can negotiate to obtain the above configuration file deployment key and business secret deployment key at the same time through a negotiation process; for example, the client and the FPGA structure can negotiate to obtain the same secret value, and then pass the above-mentioned secret value.
  • the key export function exports the configuration file deployment key and the business secret deployment key. For example, the key export function can export a 32-byte random number at one time. The first 16 bytes can be used as the configuration file deployment key and the last 16 bytes can be used as the configuration file deployment key. Business secret deployment key.
  • Fig. 2 is a flowchart of another method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment. As shown in Figure 2, the method is applied to the FPGA structure and can include the following steps:
  • Step 202 The FPGA structure deploys the circuit logic configuration file from the client, and the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs.
  • the client can include any object that needs to implement deployment operations to the FPGA structure, so that the FPGA structure can implement corresponding services or functions based on the deployed circuit logic configuration file.
  • the client may include a key management server, that is, a KMS server.
  • the KMS server may assign the FPGA structure to the corresponding business key, so that the FPGA structure can be implemented as The TEE on the blockchain node realizes the blockchain node with privacy function.
  • the client deploys an appropriate circuit logic configuration file to the FPGA structure, so that the FPGA structure can be implemented as a TEE on the blockchain node after the circuit logic configuration file is correctly configured.
  • the circuit logic configuration file may include configuration information used to implement functions such as virtual machines (EVM or other types of virtual machines), encryption and decryption, and these configuration information may be specifically represented in the form of a bit stream to facilitate burning to the FPGA structure
  • EVM virtual machines
  • this specification does not limit the form of the circuit logic configuration file.
  • An authentication root key may be pre-deployed on the FPGA structure, and the authentication root key may be preset in the FPGA structure, or the authentication root key may be deployed into the FPGA structure by the client or other objects in an offline security environment.
  • the authentication root key is an asymmetric key, and the public key corresponding to the authentication root key is disclosed, so that even if the authentication root key is not deployed by the client (preset or deployed by other objects), the client The end can also verify the signature generated by the authentication root key based on the public key that is disclosed.
  • the client can realize key agreement with the FPGA structure.
  • the client and the FPGA structure need to implement at least one information exchange during the negotiation process: when the FPGA structure sends the negotiation information to the client, the above authentication root key can be used for the negotiation
  • the information is signed, so that the client can use the public key to perform signature verification after receiving the signed negotiation information, so as to confirm that the negotiation information is indeed sent by the FPGA structure and trust the negotiation information; and when the signature fails During verification, the client can choose not to trust the received negotiation information.
  • the client and FPGA structure can complete key negotiation, so that the client and FPGA structure can obtain the same configuration file deployment key respectively.
  • the configuration file deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the configuration file deployment key can be a secret value (or master key); or, the configuration file deployment key The key can be derived from the above-mentioned secret value through the key derivation function through the client and FPGA structure respectively.
  • the client can encrypt the above-mentioned circuit logic configuration file and send the encrypted circuit logic configuration file to the FPGA structure; accordingly, the FPGA structure receives the encrypted circuit logic configuration file Later, the corresponding circuit logic configuration file can be obtained by decrypting according to the configuration file deployment key, and the circuit logic configuration file can be deployed.
  • the FPGA structure may include an FPGA chip, and when the FPGA structure deploys a circuit logic configuration file, the circuit logic configuration file can be directly read into the FPGA chip.
  • the FPGA chip is volatile, and the circuit logic configuration file deployed after the power is off will be lost, so that the client needs to re-deploy the circuit logic configuration file after power on.
  • the FPGA structure can further include a memory, which is connected to the FPGA chip, so that the circuit logic configuration file is deployed in the memory, and the FPGA chip reads the circuit logic configuration file from the memory to implement related functions ;
  • the memory is non-volatile, even if the power is off, the circuit logic configuration file can still be saved, and after the power is turned on, it is only necessary to read the FPGA chip from the memory again, without the client re-deployment.
  • the memory may have various forms, such as a non-volatile memory that can be re-erasable, such as flash memory, and a non-re-erasable memory, such as a fuse memory, which is not limited in this specification.
  • the FPGA structure may include a key management chip, and the aforementioned authentication root key may be stored in the key management chip to have high security and high reliability.
  • the authentication root key can also be stored in the aforementioned FPGA chip or memory, which is not limited in this specification.
  • Step 204 The FPGA structure signs the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public key corresponding to the authentication root key is disclosed .
  • step 206 the FPGA structure returns the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result contains information related to the circuit logic configuration file In the case of the content, confirm that the circuit logic configuration file is successfully deployed on the FPGA structure.
  • the client can obtain the public key in advance and target the FPGA structure accordingly.
  • the returned authentication result is subjected to signature verification, and if the signature verification is passed, it is determined that the authentication result is provided by the FPGA structure and the authentication result has not been tampered with.
  • the above verification process can be completed locally by the client without the need of a third party. On the one hand, it can reduce the number of interactions and improve the efficiency of verification. On the other hand, it can avoid the intervention of third parties and the increase in the number of interactions that may cause additional security risks. To ensure the reliability of the verification results does not depend on the self-control and credibility of a third party.
  • the client can verify the content related to the circuit logic configuration file contained in the authentication result, so as to determine whether the content is consistent with the circuit logic configuration file deployed by the client to the FPGA structure.
  • the above-mentioned content related to the circuit logic configuration file may be the hash value of the circuit logic configuration file, or the value obtained by calculating the hash value of the circuit logic configuration file using a preset algorithm (such as sm3 algorithm, etc.), so that
  • the client has the above-mentioned circuit logic configuration file and the above-mentioned preset algorithm is known, it can calculate the hash value of the circuit logic configuration file locally or use the above-mentioned preset algorithm to further calculate the hash value, and verify it with The above-mentioned hash values or values contained in the result are compared: if they are consistent, it indicates that the FPGA structure correctly deploys the circuit logic configuration file provided by the client; otherwise, it indicates that the circuit logic configuration file is not configured successfully.
  • the aforementioned authentication result may also include content related to the deployment key of the configuration file.
  • the client can verify the above-mentioned authentication result according to the deployment key of the configuration file exported by itself.
  • the authentication result can include the hash value of the configuration file deployment key, or the value obtained by calculating the configuration file deployment key or its hash value using a preset algorithm, which is similar to the above-mentioned circuit logic configuration file.
  • the client can calculate the hash value or the value related to the above-mentioned preset algorithm according to the configuration file deployment key exported by itself: if the authentication result contains the content related to the circuit logic configuration file and the content related to the configuration file deployment key.
  • the content related to the circuit logic configuration file and the content related to the configuration file deployment key in the authentication result can be generated as the same content, that is, the authentication result can include a circuit logic configuration file and configuration file deployment key at the same time.
  • the FPGA structure can use a preset algorithm to calculate the deployed circuit logic configuration file (or its hash value) and the negotiated configuration file deployment key (or its hash value) to obtain a value .
  • the configuration file deployment key and the known above-mentioned preset algorithm according to its own maintenance namely The value contained in the certification result can be verified.
  • the client can negotiate a key with the FPGA structure, so that the client and FPGA structure can respectively export the same business secret deployment key to use the service provided by the client
  • the key or other business secrets are deployed to the FPGA structure.
  • the client and the FPGA structure need to send negotiation information to each other, and after the FPGA structure generates the negotiation information, it can sign with the aforementioned authentication root key, and send the signed negotiation information to the client
  • the client can perform signature verification according to the public key that has been disclosed: after the signature is verified, the client determines that the negotiation information comes from the FPGA structure, and further completes the negotiation process based on the negotiation information, otherwise the client can terminate the key negotiation.
  • the client and FPGA structure can obtain the same business secret deployment key after negotiation.
  • the business secret deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the business secret deployment key can be a secret value (or master key); or, the business secret deployment key
  • the key can be derived from the above-mentioned secret value through the key derivation function through the client and FPGA structure respectively.
  • the client can encrypt the business key that needs to be deployed and send the encrypted business key to the FPGA structure; accordingly, after the FPGA structure receives the encrypted business key,
  • the corresponding service key can be obtained by decryption according to the service secret deployment key, and the service key can be deployed.
  • the service key may include: the node private key, the node public key corresponding to the node private key is disclosed; where the node public key is used to encrypt the transaction, or the node public key is symmetrical with the transaction submitting party
  • the key is commonly used to encrypt transactions through digital envelopes.
  • the node can use the node's private key to decrypt in the FPGA structure to obtain the transaction content in plain text; or, the transaction submitting party can use a randomly generated (or obtained by other means) symmetric key to encrypt the transaction, and then pass through the above-mentioned node
  • the public key encrypts the symmetric key, and submits the encrypted transaction and the encrypted symmetric key to the blockchain node, and the blockchain node can use the node private key in the FPGA structure to decrypt the encrypted symmetric key , And decrypt the encrypted transaction with the symmetric key obtained by decryption, so as to obtain the transaction content in plain text.
  • the business key may include: the business root key, the business root key or the derived key of the business root key is used to encrypt the private data generated in the trusted execution environment and store it to the blockchain node Maintained in the database.
  • the above-mentioned private data with encryption requirements may be generated.
  • the private data may include the value of the contract state generated by the execution of the smart contract, then the FPGA structure can The private data is encrypted by the business root key or its derived key, and the encrypted private data is stored in the database maintained by the blockchain node.
  • the FPGA structure when the private data needs to be read, by reading the encrypted private data into the FPGA structure, the FPGA structure can be decrypted based on the business root key or its derivative key, and the corresponding plaintext can be obtained. Private data, so as to read or update the value of the private data, or use the value of the private data to participate in other calculation processes, etc.
  • the client and the FPGA structure can negotiate to obtain the above-mentioned configuration file deployment key and business secret deployment key through two negotiation processes. Or, the client and the FPGA structure can negotiate to obtain the above configuration file deployment key and business secret deployment key at the same time through a negotiation process; for example, the client and the FPGA structure can negotiate to obtain the same secret value, and then pass the above-mentioned secret value.
  • the key export function exports the configuration file deployment key and the business secret deployment key. For example, the key export function can export a 32-byte random number at one time. The first 16 bytes can be used as the configuration file deployment key and the last 16 bytes can be used as the configuration file deployment key. Business secret deployment key.
  • Fig. 3 is a schematic flowchart of an interaction process between a client and an FPGA structure provided by an exemplary embodiment.
  • the client can be a KMS server
  • the FPGA structure is configured on the blockchain node
  • the KMS server authenticates the FPGA structure, so that if the FPGA structure is authenticated, it is required to deploy the blockchain node to the FPGA structure
  • the method may include the following steps:
  • Step 301 the FPGA structure deploys the authentication root key.
  • the authentication root key can be deployed by the manufacturer in the process of manufacturing the FPGA structure, that is, the manufacturer deploys the authentication root key to the FPGA structure, for example, to the key management chip contained in the FPGA structure.
  • the authentication root key can also be deployed by the client.
  • the user corresponding to the client can deploy the authentication root key into the FPGA structure in a physical security environment in an offline state, for example, into the above-mentioned key management chip.
  • the authentication root key deployed in the FPGA structure is an asymmetric key, that is, the authentication root key has a corresponding authentication public key, and the authentication public key is in a public state.
  • a certain website can be provided so that the client can download the above-mentioned authentication public key.
  • Step 302 the client and the FPGA structure remotely negotiate a key.
  • the client and FPGA structure can use algorithms such as SM2 to achieve key negotiation.
  • the client and the FPGA structure need to generate negotiation information separately, and exchange the negotiation information generated by each other remotely, so as to complete the negotiation process.
  • the FPGA structure can sign the negotiation information with the above authentication root key, and then send the signed negotiation information to the client.
  • the client receives the negotiation information from the remote end, it can use the pre-obtained authentication public key to sign the negotiation information: if the verification is successful, it indicates that the negotiation information does come from the FPGA structure, that is, the negotiation information is credible , So as to complete the subsequent negotiation process based on the negotiation information, otherwise terminate the key negotiation.
  • the FPGA structure has a built-in authentication root key, and the authentication public key corresponding to the authentication root key is in the public state, the client and the FPGA structure can realize remote key negotiation based on this, and the client can complete the signature locally. Verification without resorting to a third party can prevent the interaction between the client and the third party from reducing the verification efficiency, and avoid the reliability of the verification result from relying on the credibility of the third party, which helps to improve security.
  • Step 303 The client and FPGA structure respectively export the configuration file deployment key and the business secret deployment key.
  • the client and the FPGA structure can respectively generate the same secret value, and further process the secret value through the KDF function, and can derive the above-mentioned configuration file deployment key and business secret deployment key.
  • the KDF function can derive a set of 32-byte random numbers, the first 16-byte random number can be used as the configuration file deployment key, and the last 16-byte random number can be used as the business secret deployment key; of course, the KDF function can derive other The length of the random number, and each key can use other lengths respectively, this specification does not limit this.
  • the random numbers exported by the KDF function are not necessarily used to generate business keys.
  • the KDF function can export a 64-byte random number. The first 16-byte random number can be selected as the configuration file deployment key, and the last 16-byte random number can be selected as the configuration file deployment key. The number is used as the business secret deployment key, and the remaining 32 bytes of random numbers are discarded.
  • the client and FPGA structure respectively maintain the exported configuration file deployment key and business secret deployment key.
  • the FPGA structure may include an FPGA chip and a key management chip, wherein the configuration file deployment key and the business secret deployment key can be maintained in the key management chip to ensure its security.
  • step 304 the client generates and encrypts the circuit logic configuration file, and then sends the encrypted circuit logic configuration file to the FPGA structure.
  • the client encrypts the circuit logic configuration file according to the configuration file deployment key derived in step 303, so that when the encrypted circuit logic configuration file is remotely transmitted to the FPGA structure, no loss will be caused even if data leakage occurs.
  • Step 305 Decrypt the FPGA structure to obtain the circuit logic configuration file and deploy it.
  • the FPGA structure After the FPGA structure receives the encrypted circuit logic configuration file sent by the client, it can use the configuration file deployment key exported in step 303 to decrypt to obtain the circuit logic configuration file in plain text; then, the FPGA structure can configure the circuit logic in plain text File implementation deployment.
  • the FPGA structure can include an FPGA chip and a flash chip.
  • the circuit logic configuration file can be deployed in the flash chip, so that the FPGA chip can read and load the above circuit logic configuration file from the flash chip every time it is powered on, and after power off The circuit logic configuration files deployed in the flash chip will not be lost, and there is no need for repeated deployment by the client.
  • Step 306 The FPGA structure generates and signs the authentication result, and then returns the signed authentication result to the client.
  • the FPGA structure can generate the authentication result.
  • the FPGA structure can generate the hash value corresponding to the circuit logic configuration file, such as user_bitstream_hash; at the same time, the FPGA structure can generate the corresponding hash value for the aforementioned configuration file deployment key, such as userbitkey_hash; then, the FPGA structure
  • the FPGA structure further signs the generated authentication result according to the aforementioned authentication root key, so as to send the signed authentication result to the client.
  • Step 307 After receiving the signed authentication result, the client verifies the signature and authentication content.
  • the client can obtain the authentication public key corresponding to the authentication root key in advance, so that the client can perform signature verification based on the authentication public key after receiving the signed authentication result.
  • the client may further verify the authentication content contained in the authentication result, and the authentication content may include the aforementioned msg information.
  • the configuration file deployment key and the business secret deployment key are derived based on the same secret value, which also indicates that the two successfully negotiated the business secret deployment key.
  • the client can complete the verification of the authentication result locally without relying on a third party, which can reduce interaction and improve security.
  • step 308 the client determines and encrypts the node private key and the service root key, and then sends the encrypted node private key and the service root key to the FPGA structure.
  • Step 309 Decrypt the FPGA structure to obtain the node private key and the service root key.
  • the client uses the service secret deployment key obtained in step 303 to encrypt service keys such as the node private key and the service root key
  • the client can safely and remotely transmit the node private key and the service root key to the FPGA structure;
  • the FPGA structure can be decrypted based on the service secret deployment key obtained in step 303 to obtain the node private key and the service root key, and deploy the node private key and the service root key.
  • FIG. 4 is a schematic diagram of a blockchain node processing transactions provided by an exemplary embodiment.
  • the blockchain node includes the conventional execution environment on the left and the TEE formed by the FPGA structure on the right.
  • the transaction submitted by the user first enters the "transaction scheduling" interface in the conventional execution environment for type identification, and will identify The plaintext transactions of ”are left in the regular execution environment for processing (corresponding to the "transaction execution” link on the left), and the identified private transactions are passed to the TEE for processing (corresponding to the "transaction execution” link on the right).
  • the private transaction is encrypted by the user and submitted to the blockchain node.
  • the user can randomly generate a symmetric key, and the node private key deployed on the FPGA structure has a public node public key, so that the user can implement digital envelope encryption on the transaction content based on the symmetric key and the node public key: the user adopts symmetric
  • the key encrypts the transaction content of the plaintext, generates the encrypted transaction content, uses the node public key to encrypt the symmetric key, generates the encrypted symmetric key, and then uses the encrypted transaction content and the encrypted symmetric key as privacy
  • the transaction is submitted to the blockchain node at the same time.
  • the blockchain node reads the private transaction into the FPGA structure, decrypts the encrypted symmetric key through the node private key deployed in the FPGA structure, obtains the symmetric key, and further encrypts the transaction based on the symmetric key
  • the content is decrypted to obtain the transaction content in plain text, and then the transaction content is processed on the FPGA structure.
  • privacy transactions can be understood as transactions that have privacy requirements; in addition to privacy transactions, blockchain nodes may receive plaintext transactions, which are transactions that do not require privacy. Privacy requirements can be expressed in a variety of ways, and this manual does not limit this.
  • each transaction may include a type field, which is used to indicate whether the corresponding transaction is a private transaction or a plaintext transaction.
  • the blockchain node can identify the transaction type in the "transaction scheduling" interface in the conventional execution environment as shown in Figure 1.
  • transactions usually contain fields such as to, value, and data; and this embodiment adds a type field to the transaction on the basis of related technologies, such as a type field, and based on
  • the value of the type field indicates the type of the related transaction: for example, when the type field is the first value, it indicates that the related transaction is a plaintext transaction, and when the type field is the second value, it indicates that the related transaction is a private transaction.
  • the user can add an encrypted identifier to the transaction in the process of creating a transaction to express the aforementioned privacy requirements.
  • the blockchain node can determine that the transaction is a private transaction, otherwise it is determined that the transaction is a plaintext transaction.
  • the blockchain node can identify the type of smart contract called for the transaction, when the called smart contract belongs to the privacy type (for example, the smart contract contains a privacy identifier, or the code of the smart contract includes the contract status marked by the privacy identifier, etc. ), the transaction can be determined to be a private transaction, otherwise the transaction is determined to be a plaintext transaction.
  • the transactions in this specification can be used to implement relatively simple processing logic, for example, similar to the transfer logic in related technologies. At this time, whether it is the above-mentioned plaintext transaction or private transaction, it can not be related to the smart contract.
  • the transactions in this specification can also be used to implement relatively complex processing logic, which can be implemented here with the help of the above-mentioned smart contract.
  • Taking Ethereum as an example supporting users to create and/or call some complex logic in the Ethereum network is the biggest challenge that distinguishes Ethereum from Bitcoin blockchain technology.
  • the core of Ethereum as a programmable blockchain is the Ethereum Virtual Machine (EVM), and every Ethereum node can run EVM.
  • EVM is a Turing complete virtual machine, which means that various complex logic can be implemented through it. Users who publish and call smart contracts in Ethereum run on the EVM.
  • the smart contract issued or called by the plaintext transaction can be executed through the EVM to realize the "transaction execution” link in the conventional execution environment; and, by deploying the EVM in the TEE (The FPGA structure is based on the deployed circuit logic configuration file, which can realize the functions of EVM or other virtual machines).
  • the smart contract issued or called by the private transaction can be executed through the EVM to realize the "transaction execution" link in the TEE.
  • the account balance of the relevant account or the value of the contract state related to the smart contract may change, and the FPGA structure can be based on the aforementioned business root key or its derivative key to obtain these values.
  • Encryption is performed, and the encrypted value is stored in the database maintained by the blockchain node.
  • Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 5.
  • the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510.
  • the processor 502 reads the corresponding computer program from the non-volatile memory 510 to the memory 508 and then runs it to form an FPGA-based device for implementing a privacy blockchain at the logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each
  • the logic unit can also be a hardware or a logic device.
  • the FPGA-based device for implementing a privacy blockchain may include:
  • the configuration file deployment unit 61 enables the client to deploy a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment for the blockchain node ;
  • the authentication result receiving unit 62 enables the client to receive the authentication result returned by the FPGA structure, the authentication result being signed by the authentication root key deployed in the FPGA structure, and the publicity corresponding to the authentication root key Key is made public;
  • the deployment confirmation unit 63 enables the client to confirm that the circuit logic configuration file is in the FPGA structure when the authentication result passes the signature verification and the authentication result contains content related to the circuit logic configuration file. The deployment is successful.
  • the authentication root key is preset in the FPGA structure; or, the authentication root key is deployed into the FPGA structure by the client or other objects in an offline security environment.
  • the configuration file deployment unit 61 is specifically configured to:
  • the client is allowed to negotiate a configuration file deployment key with the FPGA structure according to the negotiation information sent by the FPGA structure, so that the client and the FPGA structure respectively determine the configuration file deployment key; wherein, The negotiation information is signed by the authentication root key;
  • the authentication result also includes content related to the configuration file deployment key.
  • it also includes:
  • the service key agreement unit 64 enables the client to negotiate a service secret deployment key with the FPGA structure according to the negotiation information sent by the FPGA structure, so that the client and the FPGA structure respectively determine the service Secret deployment key; wherein the negotiation information is signed by the authentication root key;
  • the service key deployment unit 65 enables the client to encrypt the service key through the service secret deployment key, and sends the encrypted service key to the FPGA structure so that the FPGA structure is based on the service
  • the secret deployment key performs decryption and deploys the service key.
  • the service key includes: a node private key, and the node public key corresponding to the node private key is disclosed;
  • the node public key is used to encrypt the transaction; or, the node public key and the symmetric key provided by the transaction submitting party are jointly used to encrypt the transaction through a digital envelope.
  • the service key includes: a service root key, and the service root key or a derivative key of the service root key is used to encrypt and store the private data generated in the trusted execution environment To the database maintained by the blockchain node.
  • the client includes a key management server.
  • Fig. 7 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 7.
  • the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710.
  • the processor 702 reads the corresponding computer program from the non-volatile memory 710 to the memory 708 and then runs it to form an FPGA-based device for implementing a privacy blockchain at the logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each
  • the logic unit can also be a hardware or a logic device.
  • the FPGA-based device for implementing a privacy blockchain may include:
  • the configuration file deployment unit 81 enables the FPGA structure to deploy the circuit logic configuration file from the client, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
  • the authentication result signing unit 82 enables the FPGA structure to sign the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, wherein the authentication root key corresponds to The public key is made public;
  • the authentication result returning unit 83 enables the FPGA structure to return the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes the same as the circuit In the case of content related to the logic configuration file, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
  • the authentication root key is preset in the FPGA structure; or, the authentication root key is deployed into the FPGA structure by the client or other objects in an offline security environment.
  • the FPGA structure includes a key management chip, and the authentication root key is stored in the key management chip.
  • the FPGA structure includes an FPGA chip and a memory; wherein the circuit logic configuration file is deployed in the memory, and the FPGA chip reads the circuit logic configuration file from the memory to implement Related functions.
  • the memory includes a non-volatile memory or a fuse memory.
  • the configuration file deployment unit 81 is specifically configured to:
  • Make the FPGA structure negotiate a configuration file deployment key with the client by sending negotiation information to the client, so that the client and the FPGA structure respectively determine the configuration file deployment key; wherein, The negotiation information is signed by the authentication root key;
  • the FPGA structure decrypts the encrypted circuit logic configuration file according to the file deployment key, and deploys the decrypted circuit logic configuration file.
  • the authentication result also includes content related to the configuration file deployment key.
  • it also includes:
  • the negotiation unit 84 enables the FPGA structure to negotiate with the client to configure the service secret deployment key by sending negotiation information to the client, so that the client and the FPGA structure respectively determine the service secret deployment Key; wherein the negotiation information is signed by the authentication root key;
  • the receiving unit 85 enables the FPGA structure to receive the encrypted service key sent by the client, where the encrypted service key is obtained by encrypting the service key by the service secret deployment key;
  • the decryption unit 86 enables the FPGA structure to decrypt the encrypted service key according to the service secret deployment key, and deploy the decrypted service key.
  • the service key includes: a node private key, and the node public key corresponding to the node private key is disclosed;
  • the node public key is used to encrypt the transaction; or, the node public key and the symmetric key provided by the transaction submitting party are jointly used to encrypt the transaction through a digital envelope.
  • the service key includes: a service root key, and the service root key or a derived key of the service root key is used to encrypt private data generated in the trusted execution environment Stored in the database maintained by the blockchain node.
  • the client includes a key management server.
  • a typical implementation device is a computer.
  • the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
  • the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
  • processors CPU
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or "in response to determination”.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Storage Device Security (AREA)

Abstract

An FPGA-based privacy block chain implementing method and device. Said method comprises: a client deploying a circuit logic configuration file to an FPGA structure at a block chain node, the circuit logic configuration file being used for implementing the FPGA structure as a trusted execution environment of the block chain node (102); the client receiving an authentication result returned by the FPGA structure, the authentication result being signed by an authentication root key deployed in the FPGA structure, and a public key corresponding to the authentication root key being published (104); and the client confirming, in cases where the authentication result passes signature verification and the authentication result contains content related to the circuit logic configuration file, that the circuit logic configuration file is successfully deployed on the FPGA structure (106).

Description

基于FPGA实现隐私区块链的方法及装置Method and device for implementing privacy blockchain based on FPGA 技术领域Technical field
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种基于FPGA实现隐私区块链的方法及装置。One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a method and device for implementing a privacy blockchain based on FPGA.
背景技术Background technique
区块链技术构建在传输网络(例如点对点网络)之上。传输网络中的网络节点利用链式数据结构来验证与存储数据,并采用分布式节点共识算法来生成和更新数据。Blockchain technology is built on a transmission network (such as a peer-to-peer network). The network nodes in the transmission network use chained data structures to verify and store data, and use distributed node consensus algorithms to generate and update data.
目前企业级的区块链平台技术上最大的两个挑战就是隐私和性能,往往这两个挑战很难同时解决。大多解决方案都是通过损失性能换取隐私,或者不大考虑隐私去追求性能。常见的解决隐私问题的加密技术,如同态加密(Homomorphic encryption)和零知识证明(Zero-knowledge proof)等复杂度高,通用性差,而且还可能带来严重的性能损失。At present, the two biggest challenges in enterprise-level blockchain platform technology are privacy and performance. It is often difficult to solve these two challenges at the same time. Most of the solutions are to lose performance in exchange for privacy, or do not consider privacy to pursue performance. Common encryption technologies that solve privacy problems, such as Homomorphic encryption and Zero-knowledge proof, are highly complex, have poor versatility, and may also cause serious performance losses.
可信执行环境(Trusted Execution Environment,TEE)是另一种解决隐私问题的方式。TEE可以起到硬件中的黑箱作用,在TEE中执行的代码和数据操作系统层都无法偷窥,只有代码中预先定义的接口才能对其进行操作。在效率方面,由于TEE的黑箱性质,在TEE中进行运算的是明文数据,而不是同态加密中的复杂密码学运算,计算过程效率没有损失,因此与TEE相结合可以在性能损失较小的前提下很大程度上提升区块链的安全性和隐私性。目前工业界十分关注TEE的方案,几乎所有主流的芯片和软件联盟都有自己的TEE解决方案,包括软件方面的TPM(Trusted Platform Module,可信赖平台模块)以及硬件方面的Intel SGX(Software Guard Extensions,软件保护扩展)、ARM Trustzone(信任区)和AMD PSP(Platform Security Processor,平台安全处理器)。Trusted Execution Environment (TEE) is another way to solve privacy issues. TEE can play the role of a black box in the hardware. Neither the code executed in the TEE nor the data operating system layer can be peeped, and only the pre-defined interface in the code can operate on it. In terms of efficiency, due to the black box nature of TEE, plaintext data is calculated in TEE instead of complex cryptographic operations in homomorphic encryption. There is no loss of efficiency in the calculation process. Therefore, the combination with TEE can achieve less performance loss. Under the premise, the security and privacy of the blockchain are greatly improved. At present, the industry is very concerned about the TEE solution. Almost all mainstream chip and software alliances have their own TEE solutions, including TPM (Trusted Platform Module) in software and Intel SGX (Software Guard Extensions) in hardware. , Software Protection Extension), ARM Trustzone (trust zone) and AMD PSP (Platform Security Processor, platform security processor).
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施例提供一种基于FPGA实现隐私区块链的方法及装置。In view of this, one or more embodiments of this specification provide a method and device for implementing a privacy blockchain based on FPGA.
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:To achieve the foregoing objectives, one or more embodiments of this specification provide technical solutions as follows:
根据本说明书一个或多个实施例的第一方面,提出了一种基于FPGA实现隐私区块链的方法,包括:According to the first aspect of one or more embodiments of this specification, a method for implementing a privacy blockchain based on FPGA is proposed, which includes:
客户端向区块链节点处的FPGA结构部署电路逻辑配置文件,所述电路逻辑配置文件用于使所述FPGA结构实现为所述区块链节点的可信执行环境;The client deploys a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment of the blockchain node;
所述客户端接收所述FPGA结构返回的认证结果,所述认证结果由所述FPGA结构内部署的认证根密钥进行签名,且所述认证根密钥对应的公钥被公开;The client receives the authentication result returned by the FPGA structure, the authentication result is signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key is made public;
所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The client confirms that the circuit logic configuration file is successfully deployed on the FPGA structure when the authentication result passes the signature verification and the authentication result includes content related to the circuit logic configuration file.
根据本说明书一个或多个实施例的第二方面,提出了一种基于FPGA实现隐私区块链的方法,包括:According to the second aspect of one or more embodiments of this specification, a method for implementing a privacy blockchain based on FPGA is proposed, which includes:
FPGA结构对来自客户端的电路逻辑配置文件进行部署,所述电路逻辑配置文件用于使所述FPGA结构实现为所属的区块链节点上的可信执行环境;The FPGA structure deploys a circuit logic configuration file from the client, and the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
所述FPGA结构通过已部署的认证根密钥对认证结果进行签名,所述认证结果包含与所述电路逻辑配置文件相关的内容,其中所述认证根密钥对应的公钥被公开;The FPGA structure signs the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public key corresponding to the authentication root key is disclosed;
所述FPGA结构将签名后的所述认证结果返回至所述客户端,以使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The FPGA structure returns the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes content related to the circuit logic configuration file In this case, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
根据本说明书一个或多个实施例的第三方面,提出了一种基于FPGA实现隐私区块链的装置,包括:According to the third aspect of one or more embodiments of this specification, a device for implementing a privacy blockchain based on FPGA is proposed, including:
配置文件部署单元,使客户端向区块链节点处的FPGA结构部署电路逻辑配置文件,所述电路逻辑配置文件用于使所述FPGA结构实现为所述区块链节点的可信执行环境;The configuration file deployment unit enables the client to deploy a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment for the blockchain node;
认证结果接收单元,使所述客户端接收所述FPGA结构返回的认证结果,所述认证结果由所述FPGA结构内部署的认证根密钥进行签名,且所述认证根密钥对应的公钥被公开;The authentication result receiving unit enables the client to receive the authentication result returned by the FPGA structure, the authentication result being signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key Be made public
部署确认单元,使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。A confirmation unit is deployed to enable the client to confirm that the circuit logic configuration file is on the FPGA structure when the authentication result passes the signature verification and the authentication result contains content related to the circuit logic configuration file The deployment was successful.
根据本说明书一个或多个实施例的第四方面,提出了一种基于FPGA实现隐私区块链的装置,包括:According to the fourth aspect of one or more embodiments of this specification, a device for implementing a privacy blockchain based on FPGA is proposed, including:
配置文件部署单元,使FPGA结构对来自客户端的电路逻辑配置文件进行部署,所 述电路逻辑配置文件用于使所述FPGA结构实现为所属的区块链节点上的可信执行环境;The configuration file deployment unit enables the FPGA structure to deploy the circuit logic configuration file from the client, and the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
认证结果签名单元,使所述FPGA结构通过已部署的认证根密钥对认证结果进行签名,所述认证结果包含与所述电路逻辑配置文件相关的内容,其中所述认证根密钥对应的公钥被公开;The authentication result signing unit causes the FPGA structure to sign the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public authentication root key corresponds to the authentication result. Key is made public;
认证结果返回单元,使所述FPGA结构将签名后的所述认证结果返回至所述客户端,以使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The authentication result returning unit is configured to enable the FPGA structure to return the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes the circuit logic In the case of configuration file-related content, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
根据本说明书一个或多个实施例的第五方面,提出了一种电子设备,包括:According to a fifth aspect of one or more embodiments of this specification, an electronic device is proposed, including:
处理器;processor;
用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。Wherein, the processor implements the method according to the first aspect by running the executable instruction.
根据本说明书一个或多个实施例的第六方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。According to the sixth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
根据本说明书一个或多个实施例的第七方面,提出了一种电子设备,包括:According to a seventh aspect of one or more embodiments of this specification, an electronic device is proposed, including:
处理器;processor;
用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
其中,所述处理器通过运行所述可执行指令以实现如第二方面所述的方法。Wherein, the processor implements the method according to the second aspect by running the executable instruction.
根据本说明书一个或多个实施例的第八方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第二方面所述方法的步骤。According to the eighth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided with computer instructions stored thereon, which when executed by a processor implements the steps of the method described in the second aspect.
附图说明Description of the drawings
图1是一示例性实施例提供的一种基于FPGA实现隐私区块链的方法的流程图。Fig. 1 is a flowchart of a method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
图2是一示例性实施例提供的另一种基于FPGA实现隐私区块链的方法的流程图。Fig. 2 is a flowchart of another method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
图3是一示例性实施例提供的一种客户端与FPGA结构之间的交互过程的示意流程图。Fig. 3 is a schematic flowchart of an interaction process between a client and an FPGA structure provided by an exemplary embodiment.
图4是一示例性实施例提供的一种区块链节点对交易进行处理的示意图。Fig. 4 is a schematic diagram of a blockchain node processing a transaction according to an exemplary embodiment.
图5是一示例性实施例提供的一种设备的结构示意图。Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment.
图6是一示例性实施例提供的一种基于FPGA实现隐私区块链的装置的框图。Fig. 6 is a block diagram of a device for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
图7是一示例性实施例提供的另一种设备的结构示意图。Fig. 7 is a schematic structural diagram of another device provided by an exemplary embodiment.
图8是一示例性实施例提供的另一种基于FPGA实现隐私区块链的装置的框图。Fig. 8 is a block diagram of another device for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。The exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with one or more embodiments of this specification. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding method are not necessarily executed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. description.
区块链一般被划分为三种类型:公有链(Public Blockchain),私有链(Private Blockchain)和联盟链(Consortium Blockchain)。此外,还有多种类型的结合,比如私有链+联盟链、联盟链+公有链等不同组合形式。其中去中心化程度最高的是公有链。公有链以比特币、以太坊为代表,加入公有链的参与者可以读取链上的数据记录、参与交易以及竞争新区块的记账权等。而且,各参与者(即节点)可自由加入以及退出网络,并进行相关操作。私有链则相反,该网络的写入权限由某个组织或者机构控制,数据读取权限受组织规定。简单来说,私有链可以为一个弱中心化系统,参与节点具有严格限制且少。这种类型的区块链更适合于特定机构内部使用。联盟链则是介于公有链以及私有链之间的区块链,可实现“部分去中心化”。联盟链中各个节点通常有与之相对应的实体机构或者组织;参与者通过授权加入网络并组成利益相关联盟,共同维护区块链运行。Block chains are generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain. In addition, there are many types of combinations, such as private chain + alliance chain, alliance chain + public chain and other different combinations. Among them, the most decentralized one is the public chain. The public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks. Moreover, each participant (ie, node) can freely join and exit the network, and perform related operations. The private chain is the opposite. The write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization. In simple terms, the private chain can be a weakly centralized system with strict restrictions and few participating nodes. This type of blockchain is more suitable for internal use by specific institutions. Consortium chain is a block chain between public chain and private chain, which can realize "partial decentralization". Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain.
不论是公有链、私有链还是联盟链,区块链网络中的节点出于隐私保护的目的,均可能通过区块链与TEE(Trusted Execution Environment,可信执行环境)相结合的解决 方案,在TEE内执行收到的交易。TEE是基于CPU硬件的安全扩展,且与外部完全隔离的可信执行环境。TEE最早是由Global Platform提出的概念,用于解决移动设备上资源的安全隔离,平行于操作系统为应用程序提供可信安全的执行环境。ARM的Trust Zone技术最早实现了真正商用的TEE技术。伴随着互联网的高速发展,安全的需求越来越高,不仅限于移动设备,云端设备,数据中心都对TEE提出了更多的需求。TEE的概念也得到了高速的发展和扩充。现在所说的TEE相比与最初提出的概念已经是更加广义的TEE。例如,服务器芯片厂商Intel,AMD等都先后推出了硬件辅助的TEE并丰富了TEE的概念和特性,在工业界得到了广泛的认可。现在提起的TEE通常更多指这类硬件辅助的TEE技术。Regardless of whether it is a public chain, a private chain or a consortium chain, for the purpose of privacy protection, the nodes in the blockchain network may use a solution that combines the blockchain and the TEE (Trusted Execution Environment). Execute received transactions within TEE. TEE is a secure extension based on CPU hardware and a trusted execution environment that is completely isolated from the outside. TEE was first proposed by Global Platform to solve the security isolation of resources on mobile devices, and parallel to the operating system to provide a trusted and secure execution environment for applications. ARM's Trust Zone technology is the first to realize the real commercial TEE technology. With the rapid development of the Internet, security requirements are getting higher and higher. Not only mobile devices, cloud devices, and data centers have put forward more demands on TEE. The concept of TEE has also been rapidly developed and expanded. Compared with the originally proposed concept, the TEE referred to now is a more generalized TEE. For example, server chip manufacturers Intel and AMD have successively introduced hardware-assisted TEE and enriched the concepts and features of TEE, which has been widely recognized in the industry. The TEE mentioned now usually refers more to this kind of hardware-assisted TEE technology.
以Intel SGX技术为例,SGX提供了围圈(enclave,也称为飞地),即内存中一个加密的可信执行区域,由CPU保护数据不被窃取。以第一区块链节点采用支持SGX的CPU为例,利用新增的处理器指令,在内存中可以分配一部分区域EPC(Enclave Page Cache,围圈页面缓存或飞地页面缓存),通过CPU内的加密引擎MEE(Memory Encryption Engine)对其中的数据进行加密。EPC中加密的内容只有进入CPU后才会被解密成明文。因此,在SGX中,用户可以不信任操作系统、VMM(Virtual Machine Monitor,虚拟机监控器)、甚至BIOS(Basic Input Output System,基本输入输出系统),只需要信任CPU便能确保隐私数据不会泄漏。因此,围圈就相当于SGX技术下产生的TEE。Taking Intel SGX technology as an example, SGX provides an enclave (also known as an enclave), which is an encrypted trusted execution area in the memory, and the CPU protects data from being stolen. Taking the first blockchain node using a CPU that supports SGX as an example, using the newly added processor instructions, a part of the area EPC (Enclave Page Cache, enclave page cache or enclave page cache) can be allocated in the memory, and through the CPU The encryption engine MEE (Memory Encryption Engine) encrypts the data in it. The encrypted content in EPC will be decrypted into plain text only after entering the CPU. Therefore, in SGX, users can distrust the operating system, VMM (Virtual Machine Monitor), and even BIOS (Basic Input Output System). They only need to trust the CPU to ensure that private data will not leakage. Therefore, the enclosure is equivalent to the TEE produced under SGX technology.
不同于移动端,云端访问需要远程访问,终端用户对硬件平台不可见,因此使用TEE的第一步就是要确认TEE的真实可信。在相关技术中,采用远程证明机制对TEE是否真实可信进行确认。以Intel SGX技术为例,当某一挑战方希望验证目标设备中的某一围圈时,该待验证围圈首先将自身部署的配置文件生成为Report,比如该Report可以包含该待验证围圈所部署的配置文件的哈希值等;然后,待验证围圈利用本地认证机制获取远程可验证的Quote,具体可以由目标设备上称作Quoting Enclave(QE)的特殊围圈利用目标设备CPU内部署的非对称密钥对上述的Report进行签名,从而生成上述可远程验证的Quote,并由目标设备将该Quote发送至挑战方。上述的非对称密钥是在生产过程中被烧入CPU内,不同CPU内烧入的非对称密钥完全不同,且各个非对称密钥对应的公钥被统一维护于IAS(Intel Attestation Server)处。因此,挑战方需要将目标设备提供的Quote进一步发送至IAS,由IAS对Quote所含的签名进行验证,从而判断目标设备上SGX平台的有效性,并将判断结果反馈至挑战方。如果判断结果表明目标设备上的SGX平台有效,那么挑战方可以进一步验证Quote所含的Report,比如将Report 所含的哈希值与挑战方所持有的标准配置文件对应的哈希值进行比较:如果哈希值一致,挑战方可以确定该标准配置文件被正确地配置于目标设备的待验证围圈内,即上述的待验证围圈通过了远程证明。Different from the mobile terminal, cloud access requires remote access, and the end user is invisible to the hardware platform. Therefore, the first step in using TEE is to confirm the authenticity of TEE. In related technologies, a remote attestation mechanism is used to confirm whether the TEE is authentic and credible. Taking Intel SGX technology as an example, when a challenger wants to verify a certain circle in the target device, the circle to be verified first generates the configuration file deployed by itself as a Report, for example, the report can include the circle to be verified The hash value of the deployed configuration file, etc.; then, the enclave to be verified uses the local authentication mechanism to obtain the remote verifiable Quote. Specifically, a special enclave called Quoting Enclave (QE) on the target device can use the CPU of the target device The deployed asymmetric key signs the aforementioned Report, thereby generating the aforementioned remotely verifiable Quote, and the target device sends the Quote to the challenger. The above asymmetric keys are burned into the CPU during the production process. The asymmetric keys burned in different CPUs are completely different, and the public key corresponding to each asymmetric key is uniformly maintained in IAS (Intel Attestation Server) Place. Therefore, the challenger needs to further send the Quote provided by the target device to the IAS, and the IAS will verify the signature contained in the Quote to determine the validity of the SGX platform on the target device and feed back the judgment result to the challenger. If the judgment result shows that the SGX platform on the target device is valid, the challenger can further verify the Report contained in the Quote, for example, compare the hash value contained in the Report with the hash value corresponding to the standard configuration file held by the challenger : If the hash values are consistent, the challenger can determine that the standard configuration file is correctly configured in the circle to be verified of the target device, that is, the circle to be verified above has passed the remote certification.
然而,相关技术中的远程证明机制虽然可以证明在TEE内部署了正确的配置文件,但TEE本身所依托的运行环境并不能够被验证;比如,在需要实现隐私功能的区块链节点上,TEE内需要配置用于执行智能合约的虚拟机,该虚拟机所执行的指令并非直接执行,而是实际上执行了对应的若干条X86指令(假定目标设备采用X86架构),从而造成了一定程度上的安全性风险。However, although the remote certification mechanism in related technologies can prove that the correct configuration file is deployed in the TEE, the operating environment on which the TEE itself depends cannot be verified; for example, on the blockchain nodes that need to implement privacy functions, A virtual machine for executing smart contracts needs to be configured in the TEE. The instructions executed by the virtual machine are not directly executed, but actually execute a number of corresponding X86 instructions (assuming that the target device adopts the X86 architecture), which causes a certain degree of Security risks on the Internet.
以下结合实施例说明本说明书提供的一种基于FPGA实现隐私区块链的方法,以提升安全性。The following describes a method for implementing a privacy blockchain based on FPGA provided in this specification in conjunction with embodiments to improve security.
图1是一示例性实施例提供的一种基于FPGA实现隐私区块链的方法的流程图。如图1所示,该方法应用于客户端,可以包括以下步骤:Fig. 1 is a flowchart of a method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment. As shown in Figure 1, the method is applied to the client and can include the following steps:
步骤102,客户端向区块链节点处的FPGA结构部署电路逻辑配置文件,所述电路逻辑配置文件用于使所述FPGA结构实现为所述区块链节点的可信执行环境。Step 102: The client deploys a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment of the blockchain node.
客户端可以包括需要向FPGA结构实施部署操作的任意对象,使得FPGA结构可以基于所部属的电路逻辑配置文件而实现相应的服务或功能。例如,客户端可以包括密钥管理服务器,即KMS(Key Management Service)服务器,该KMS服务器在确定FPGA结构上部署了正确的电路逻辑配置文件后,可以将FPGA结构分配相应的业务密钥,使得FPGA结构可以实现为区块链节点上的TEE,从而实现具有隐私功能的区块链节点。The client can include any object that needs to implement deployment operations to the FPGA structure, so that the FPGA structure can implement corresponding services or functions based on the deployed circuit logic configuration file. For example, the client can include a key management server, that is, a KMS (Key Management Service) server. After determining that the correct circuit logic configuration file is deployed on the FPGA structure, the KMS server can assign the corresponding service key to the FPGA structure so that The FPGA structure can be implemented as a TEE on a blockchain node, thereby realizing a blockchain node with privacy functions.
因此,客户端通过向FPGA结构部署恰当的电路逻辑配置文件,使得FPGA结构在正确地配置了该电路逻辑配置文件后,即可实现为区块链节点上的TEE。例如,该电路逻辑配置文件可以包括用于实现虚拟机(以前述的以太坊区块链为例,该虚拟机可以为以太坊虚拟机(Ethereum Virtual Machine,简称EVM);在其他区块链中也可以为其他类型的虚拟机)、加解密等功能的配置信息,这些配置信息具体可以表征为比特流的形式以便于烧录至FPGA结构,当然本说明书并不限制电路逻辑配置文件所采用的形式。Therefore, the client deploys an appropriate circuit logic configuration file to the FPGA structure, so that the FPGA structure can be implemented as a TEE on the blockchain node after the circuit logic configuration file is correctly configured. For example, the circuit logic configuration file may include a virtual machine used to implement (taking the aforementioned Ethereum blockchain as an example, the virtual machine may be an Ethereum Virtual Machine (EVM); in other blockchains) It can also be the configuration information of other types of virtual machines), encryption and decryption functions. These configuration information can be specifically represented in the form of bitstreams to facilitate burning to the FPGA structure. Of course, this specification does not limit the circuit logic configuration files used form.
FPGA结构上可以预先部署有认证根密钥(Attestation Key),该认证根密钥可以被预置于FPGA结构中,或者该认证根密钥可由客户端或其他对象在离线安全环境下部署至FPGA结构中。其中,该认证根密钥属于非对称密钥,且该认证根密钥对应的公钥被公开,使得即便该认证根密钥并非由客户端所部署(预置或其他对象所部署),客户端 也可以基于被公开的公钥对该认证根密钥生成的签名进行验证。The FPGA structure can be pre-deployed with an authentication root key (Attestation Key), the authentication root key can be pre-placed in the FPGA structure, or the authentication root key can be deployed to the FPGA in an offline secure environment by the client or other objects Structure. Wherein, the authentication root key is an asymmetric key, and the public key corresponding to the authentication root key is disclosed, so that even if the authentication root key is not deployed by the client (preset or deployed by other objects), the client The end can also verify the signature generated by the authentication root key based on the public key that is disclosed.
客户端可以与FPGA结构之间实现密钥协商。假定采用SM2(或其他算法)算法实现协商,客户端与FPGA结构需要在协商过程中实施至少一次信息交互:当FPGA结构向客户端发送协商信息时,可以采用上述的认证根密钥对该协商信息进行签名,使得客户端在收到签名后的协商信息后,可以利用被公开的公钥进行签名验证,从而确定该协商信息确实由FPGA结构发出,并信任该协商信息;而当签名未通过验证时,客户端可以选择不信任收到的协商信息。基于上述过程,客户端与FPGA结构可以完成密钥协商,使得客户端与FPGA结构可以分别获得相同的配置文件部署密钥。其中,该配置文件部署密钥可以由客户端与FPGA结构通过密钥协商过程直接得到,即该配置文件部署密钥可以为秘密值(或称,主密钥);或者,该配置文件部署密钥可由客户端与FPGA结构分别通过密钥导出函数(Key Derivation Function,简称KDF)从上述的秘密值导出得到。基于协商得到的配置文件部署密钥,客户端可以对上述的电路逻辑配置文件进行加密,并将加密后电路逻辑配置文件发送至FPGA结构;相应地,FPGA结构在收到加密后电路逻辑配置文件后,可以根据配置文件部署密钥进行解密得到相应的电路逻辑配置文件,并部署该电路逻辑配置文件。The client can realize key agreement with the FPGA structure. Assuming that the SM2 (or other algorithm) algorithm is used to realize the negotiation, the client and the FPGA structure need to implement at least one information exchange during the negotiation process: when the FPGA structure sends the negotiation information to the client, the above authentication root key can be used for the negotiation The information is signed, so that the client can use the public key to perform signature verification after receiving the signed negotiation information, so as to confirm that the negotiation information is indeed sent by the FPGA structure and trust the negotiation information; and when the signature fails During verification, the client can choose not to trust the received negotiation information. Based on the above process, the client and FPGA structure can complete key negotiation, so that the client and FPGA structure can obtain the same configuration file deployment key respectively. Among them, the configuration file deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the configuration file deployment key can be a secret value (or master key); or, the configuration file deployment key The key can be derived from the above-mentioned secret value by the client and the FPGA structure respectively through the Key Derivation Function (KDF). Based on the configuration file deployment key obtained through negotiation, the client can encrypt the above-mentioned circuit logic configuration file and send the encrypted circuit logic configuration file to the FPGA structure; accordingly, the FPGA structure receives the encrypted circuit logic configuration file Later, the corresponding circuit logic configuration file can be obtained by decrypting according to the configuration file deployment key, and the circuit logic configuration file can be deployed.
FPGA结构可以包括FPGA芯片,而FPGA结构在部署电路逻辑配置文件时,可以将电路逻辑配置文件直接读入FPGA芯片内。但是,FPGA芯片具有易失性,断电后部署的电路逻辑配置文件就会丢失,使得重新上电后需要客户端重新部署电路逻辑配置文件。因此,为了减少客户端的部署次数,FPGA结构可以进一步包含存储器,该存储器与FPGA芯片相连,使得电路逻辑配置文件被部署于存储器中,且FPGA芯片从存储器中读取电路逻辑配置文件以实现相关功能;其中,存储器具有非易失性,即便断电仍然可以保存电路逻辑配置文件,而重新上电后只需重新从存储器读入FPGA芯片即可,无需客户端重新部署。存储器可以具有多种形式,比如闪存(flash)等可重复擦写的非易失性存储器,再比如熔丝存储器等不可重复擦写的存储器等,本说明书并不对此进行限制。The FPGA structure may include an FPGA chip, and when the FPGA structure deploys a circuit logic configuration file, the circuit logic configuration file can be directly read into the FPGA chip. However, the FPGA chip is volatile, and the circuit logic configuration file deployed after the power is off will be lost, so that the client needs to re-deploy the circuit logic configuration file after power on. Therefore, in order to reduce the number of deployments of the client, the FPGA structure can further include a memory, which is connected to the FPGA chip, so that the circuit logic configuration file is deployed in the memory, and the FPGA chip reads the circuit logic configuration file from the memory to implement related functions ; Among them, the memory is non-volatile, even if the power is off, the circuit logic configuration file can still be saved, and after the power is turned on, it is only necessary to read the FPGA chip from the memory again, without the client re-deployment. The memory may have various forms, such as non-volatile memory that can be repeatedly erased and writable such as flash memory, and non-repeatable memory such as fuse memory, which is not limited in this specification.
FPGA结构可以包括密钥管理芯片,前述的认证根密钥可以被存储于该密钥管理芯片中,以具备高安全性和高可靠度。当然,认证根密钥也可以存储于诸如前述的FPGA芯片或存储器中,本说明书并不对此进行限制。The FPGA structure may include a key management chip, and the aforementioned authentication root key may be stored in the key management chip to have high security and high reliability. Of course, the authentication root key can also be stored in the aforementioned FPGA chip or memory, which is not limited in this specification.
步骤104,所述客户端接收所述FPGA结构返回的认证结果,所述认证结果由所述FPGA结构内部署的认证根密钥进行签名,且所述认证根密钥对应的公钥被公开。Step 104: The client receives the authentication result returned by the FPGA structure, the authentication result is signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key is made public.
步骤106,所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。Step 106: The client confirms that the circuit logic configuration file is successfully deployed on the FPGA structure when the authentication result passes the signature verification and the authentication result contains content related to the circuit logic configuration file .
如前所述,由于FPGA结构内部署的认证根密钥为非对称密钥,且该认证根密钥对应的公钥被公开,因而客户端可以提前获得该公钥,并据此针对FPGA结构返回的认证结果进行签名验证,并在签名验证通过的情况下确定该认证结果由FPGA结构提供且认证结果未被篡改。上述验证过程可由客户端在本地完成,而无需借助于第三方实现,一方面可以减少交互次数、提升验证效率,另一方面可以避免第三方的介入及交互次数的增加而造成额外的安全风险,确保验证结果的可靠性不依赖于第三方的自制力与可信度。As mentioned earlier, since the authentication root key deployed in the FPGA structure is an asymmetric key, and the public key corresponding to the authentication root key is disclosed, the client can obtain the public key in advance and target the FPGA structure accordingly. The returned authentication result is subjected to signature verification, and if the signature verification is passed, it is determined that the authentication result is provided by the FPGA structure and the authentication result has not been tampered with. The above verification process can be completed locally by the client without the need of a third party. On the one hand, it can reduce the number of interactions and improve the efficiency of verification. On the other hand, it can avoid the intervention of third parties and the increase in the number of interactions that may cause additional security risks. To ensure the reliability of the verification results does not depend on the self-control and credibility of a third party.
客户端可以对认证结果所含的与电路逻辑配置文件相关的内容进行验证,从而确定该内容与客户端向FPGA结构部署的电路逻辑配置文件是否一致。譬如上述与电路逻辑配置文件相关的内容可以为该电路逻辑配置文件的哈希值,或者采用预设算法(例如sm3算法等)对该电路逻辑配置文件的哈希值进行计算后的数值,使得客户端在已有上述电路逻辑配置文件、已知上述预设算法的情况下,可以在本地计算电路逻辑配置文件的哈希值或者采用上述预设算法对该哈希值进一步计算,并与认证结果包含的上述哈希值或数值进行比较:若一致,则表明FPGA结构正确地部署了客户端提供的电路逻辑配置文件,否则表明电路逻辑配置文件未配置成功。The client can verify the content related to the circuit logic configuration file contained in the authentication result, so as to determine whether the content is consistent with the circuit logic configuration file deployed by the client to the FPGA structure. For example, the above-mentioned content related to the circuit logic configuration file may be the hash value of the circuit logic configuration file, or the value obtained by calculating the hash value of the circuit logic configuration file using a preset algorithm (such as sm3 algorithm, etc.), so that In the case that the client has the above-mentioned circuit logic configuration file and the above-mentioned preset algorithm is known, it can calculate the hash value of the circuit logic configuration file locally or use the above-mentioned preset algorithm to further calculate the hash value, and verify it with The above-mentioned hash values or values contained in the result are compared: if they are consistent, it indicates that the FPGA structure correctly deploys the circuit logic configuration file provided by the client; otherwise, it indicates that the circuit logic configuration file is not configured successfully.
进一步地,上述的认证结果中还可以包含与配置文件部署密钥相关的内容。相应地,客户端可以根据自身导出的配置文件部署密钥对上述的认证结果进行验证。例如,认证结果中可以包含配置文件部署密钥的哈希值,或者采用预设算法对配置文件部署密钥或其哈希值进行计算得到的数值,那么与上述电路逻辑配置文件相类似的,客户端可以根据自身导出的配置文件部署密钥计算哈希值或与上述预设算法相关的数值:如果认证结果包含的与电路逻辑配置文件相关的内容、与配置文件部署密钥相关的内容均通过验证,则表明FPGA结构与客户端之间成功协商了配置文件部署密钥,并且FPGA结构正确地部署了客户端提供的电路逻辑配置文件,否则表明密钥协商失败或电路逻辑配置文件部署失败。再例如,认证结果中与电路逻辑配置文件相关的内容、与配置文件部署密钥相关的内容可以被生成为同一内容,即认证结果中可以包含一同时与电路逻辑配置文件、配置文件部署密钥相关的内容;比如,FPGA结构可以采用预设算法对所部署的电路逻辑配置文件(或其哈希值)、协商得到的配置文件部署密钥(或其哈希值)进行计算并得到一数值,以作为上述认证结果中同时与电路逻辑配置文件、配置文件部署密钥相关 的内容,而客户端根据自身维护的电路逻辑配置文件、配置文件部署密钥和已知的上述预设算法,即可对认证结果所含的数值进行验证。Further, the aforementioned authentication result may also include content related to the deployment key of the configuration file. Correspondingly, the client can verify the above-mentioned authentication result according to the deployment key of the configuration file exported by itself. For example, the authentication result can include the hash value of the configuration file deployment key, or the value obtained by calculating the configuration file deployment key or its hash value using a preset algorithm, which is similar to the above-mentioned circuit logic configuration file. The client can calculate the hash value or the value related to the above-mentioned preset algorithm according to the configuration file deployment key exported by itself: if the authentication result contains the content related to the circuit logic configuration file and the content related to the configuration file deployment key. Passing the verification indicates that the FPGA structure and the client have successfully negotiated the configuration file deployment key, and the FPGA structure has correctly deployed the circuit logic configuration file provided by the client, otherwise it indicates that the key negotiation failed or the circuit logic configuration file deployment failed . For another example, the content related to the circuit logic configuration file and the content related to the configuration file deployment key in the authentication result can be generated as the same content, that is, the authentication result can include a circuit logic configuration file and configuration file deployment key at the same time. Related content; for example, the FPGA structure can use a preset algorithm to calculate the deployed circuit logic configuration file (or its hash value) and the negotiated configuration file deployment key (or its hash value) to obtain a value , As the content related to the circuit logic configuration file and the configuration file deployment key in the above authentication result, and the client maintains the circuit logic configuration file, the configuration file deployment key and the known above-mentioned preset algorithm according to its own maintenance, namely The value contained in the certification result can be verified.
与上述配置文件部署密钥相类似的,客户端可与FPGA结构之间进行密钥协商,使得客户端与FPGA结构可以分别导出相同的业务秘密部署密钥,以用于将客户端提供的业务密钥或其他业务秘密部署至FPGA结构。其中,在密钥协商过程中,客户端与FPGA结构需要相互发送协商信息,而FPGA结构在生成协商信息后,可以通过前述的认证根密钥进行签名,并将签名后的协商信息发送至客户端,而客户端可以根据已公开的公钥进行签名验证:在签名通过验证后,客户端确定协商信息来自FPGA结构,并进一步基于该协商信息完成协商过程,否则客户端可以终止密钥协商。最终,客户端与FPGA结构经过协商后,可以分别获得相同的业务秘密部署密钥。其中,该业务秘密部署密钥可以由客户端与FPGA结构通过密钥协商过程直接得到,即该业务秘密部署密钥可以为秘密值(或称,主密钥);或者,该业务秘密部署密钥可由客户端与FPGA结构分别通过密钥导出函数从上述的秘密值导出得到。Similar to the configuration file deployment key mentioned above, the client can negotiate a key with the FPGA structure, so that the client and FPGA structure can respectively export the same business secret deployment key to use the service provided by the client The key or other business secrets are deployed to the FPGA structure. Among them, in the key negotiation process, the client and the FPGA structure need to send negotiation information to each other, and after the FPGA structure generates the negotiation information, it can sign with the aforementioned authentication root key, and send the signed negotiation information to the client The client can perform signature verification according to the public key that has been disclosed: after the signature is verified, the client determines that the negotiation information comes from the FPGA structure, and further completes the negotiation process based on the negotiation information, otherwise the client can terminate the key negotiation. Finally, the client and FPGA structure can obtain the same business secret deployment key after negotiation. Among them, the business secret deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the business secret deployment key can be a secret value (or master key); or, the business secret deployment key The key can be derived from the above-mentioned secret value through the key derivation function through the client and FPGA structure respectively.
基于协商得到的业务秘密部署密钥,客户端可以对需要部署的业务密钥进行加密,并将加密后业务密钥发送至FPGA结构;相应地,FPGA结构在收到加密后业务密钥后,可以根据业务秘密部署密钥进行解密得到相应的业务密钥,并部署该业务密钥。Based on the negotiated business secret deployment key, the client can encrypt the business key that needs to be deployed and send the encrypted business key to the FPGA structure; accordingly, after the FPGA structure receives the encrypted business key, The corresponding service key can be obtained by decryption according to the service secret deployment key, and the service key can be deployed.
例如,业务密钥可以包括:节点私钥,该节点私钥对应的节点公钥被公开;其中,该节点公钥被用于对交易进行加密,或者该节点公钥与交易提交方提供的对称密钥被共同用于通过数字信封方式对交易进行加密。以区块链场景下的隐私交易为例,假定交易提交方希望对提交的交易内容保密,交易提交方可以通过上述的节点公钥对交易进行加密后提交至区块链节点,而区块链节点可以在FPGA结构中利用节点私钥进行解密,从而得到明文的交易内容;或者,交易提交方可以采用随机生成(或通过其他方式得到)的对称密钥对交易进行加密,在通过上述的节点公钥对该对称密钥进行加密,并将加密后交易和加密后对称密钥提交至区块链节点,而区块链节点可以在FPGA结构中利用节点私钥对加密后对称密钥进行解密,并通过解密得到的对称密钥对加密后交易进行解密,从而得到明文的交易内容。For example, the service key may include: the node private key, the node public key corresponding to the node private key is disclosed; where the node public key is used to encrypt the transaction, or the node public key is symmetrical with the transaction submitting party The key is commonly used to encrypt transactions through digital envelopes. Take the privacy transaction in the blockchain scenario as an example. Assuming that the transaction submitting party wants to keep the content of the submitted transaction confidential, the transaction submitting party can encrypt the transaction with the above-mentioned node public key and submit it to the blockchain node. The node can use the node's private key to decrypt in the FPGA structure to obtain the transaction content in plain text; or, the transaction submitting party can use a randomly generated (or obtained by other means) symmetric key to encrypt the transaction, and then pass through the above-mentioned node The public key encrypts the symmetric key, and submits the encrypted transaction and the encrypted symmetric key to the blockchain node, and the blockchain node can use the node private key in the FPGA structure to decrypt the encrypted symmetric key , And decrypt the encrypted transaction with the symmetric key obtained by decryption, so as to obtain the transaction content in plain text.
再例如,业务密钥可以包括:业务根密钥,该业务根密钥或该业务根密钥的衍生密钥用于对可信执行环境内产生的隐私数据进行加密后存储至区块链节点维护的数据库中。例如,区块链节点在FPGA结构所形成的TEE内执行交易后,可能产生存在加密需求的上述隐私数据,比如该隐私数据可以包括执行智能合约所产生的合约状态的取值, 那么FPGA结构可以通过上述的业务根密钥或其衍生密钥对隐私数据进行加密,并将加密后的隐私数据存储至区块链节点维护的数据库中。相应地,在需要读取该隐私数据时,通过将加密后的隐私数据读入FPGA结构中,使得FPGA结构可以基于上述的业务根密钥或其衍生密钥进行解密,即可得到相应明文的隐私数据,以便于读取或更新该隐私数据的数值,或将该隐私数据的数值用于参与其他计算过程等。For another example, the business key may include: the business root key, the business root key or the derived key of the business root key is used to encrypt the private data generated in the trusted execution environment and store it to the blockchain node Maintained in the database. For example, after a blockchain node executes a transaction in the TEE formed by the FPGA structure, the above-mentioned private data with encryption requirements may be generated. For example, the private data may include the value of the contract state generated by the execution of the smart contract, then the FPGA structure may The private data is encrypted by the business root key or its derived key, and the encrypted private data is stored in the database maintained by the blockchain node. Correspondingly, when the private data needs to be read, by reading the encrypted private data into the FPGA structure, the FPGA structure can be decrypted based on the business root key or its derivative key, and the corresponding plaintext can be obtained. Private data, so as to read or update the value of the private data, or use the value of the private data to participate in other calculation processes, etc.
客户端与FPGA结构可以通过两次协商过程,分别协商得到上述的配置文件部署密钥和业务秘密部署密钥。或者,客户端与FPGA结构可以通过一次协商过程,同时协商得到上述的配置文件部署密钥和业务秘密部署密钥;例如,客户端与FPGA结构可以协商得到相同的秘密值,然后通过上述的密钥导出函数导出配置文件部署密钥和业务秘密部署密钥,譬如密钥导出函数可以一次性导出32字节随机数,其中前16字节可作为配置文件部署密钥、后16字节可作为业务秘密部署密钥。The client and the FPGA structure can negotiate to obtain the above-mentioned configuration file deployment key and business secret deployment key through two negotiation processes. Or, the client and the FPGA structure can negotiate to obtain the above configuration file deployment key and business secret deployment key at the same time through a negotiation process; for example, the client and the FPGA structure can negotiate to obtain the same secret value, and then pass the above-mentioned secret value. The key export function exports the configuration file deployment key and the business secret deployment key. For example, the key export function can export a 32-byte random number at one time. The first 16 bytes can be used as the configuration file deployment key and the last 16 bytes can be used as the configuration file deployment key. Business secret deployment key.
图2是一示例性实施例提供的另一种基于FPGA实现隐私区块链的方法的流程图。如图2所示,该方法应用于FPGA结构,可以包括以下步骤:Fig. 2 is a flowchart of another method for implementing a privacy blockchain based on FPGA provided by an exemplary embodiment. As shown in Figure 2, the method is applied to the FPGA structure and can include the following steps:
步骤202,FPGA结构对来自客户端的电路逻辑配置文件进行部署,所述电路逻辑配置文件用于使所述FPGA结构实现为所属的区块链节点上的可信执行环境。Step 202: The FPGA structure deploys the circuit logic configuration file from the client, and the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs.
客户端可以包括需要向FPGA结构实施部署操作的任意对象,使得FPGA结构可以基于所部属的电路逻辑配置文件而实现相应的服务或功能。例如,客户端可以包括密钥管理服务器,即KMS服务器,该KMS服务器在确定FPGA结构上部署了正确的电路逻辑配置文件后,可以将FPGA结构分配相应的业务密钥,使得FPGA结构可以实现为区块链节点上的TEE,从而实现具有隐私功能的区块链节点。The client can include any object that needs to implement deployment operations to the FPGA structure, so that the FPGA structure can implement corresponding services or functions based on the deployed circuit logic configuration file. For example, the client may include a key management server, that is, a KMS server. After determining that the correct circuit logic configuration file is deployed on the FPGA structure, the KMS server may assign the FPGA structure to the corresponding business key, so that the FPGA structure can be implemented as The TEE on the blockchain node realizes the blockchain node with privacy function.
因此,客户端通过向FPGA结构部署恰当的电路逻辑配置文件,使得FPGA结构在正确地配置了该电路逻辑配置文件后,即可实现为区块链节点上的TEE。例如,该电路逻辑配置文件可以包括用于实现虚拟机(EVM或其他类型的虚拟机)、加解密等功能的配置信息,这些配置信息具体可以表征为比特流的形式以便于烧录至FPGA结构,当然本说明书并不限制电路逻辑配置文件所采用的形式。Therefore, the client deploys an appropriate circuit logic configuration file to the FPGA structure, so that the FPGA structure can be implemented as a TEE on the blockchain node after the circuit logic configuration file is correctly configured. For example, the circuit logic configuration file may include configuration information used to implement functions such as virtual machines (EVM or other types of virtual machines), encryption and decryption, and these configuration information may be specifically represented in the form of a bit stream to facilitate burning to the FPGA structure Of course, this specification does not limit the form of the circuit logic configuration file.
FPGA结构上可以预先部署有认证根密钥,该认证根密钥可以被预置于FPGA结构中,或者该认证根密钥可由客户端或其他对象在离线安全环境下部署至FPGA结构中。其中,该认证根密钥属于非对称密钥,且该认证根密钥对应的公钥被公开,使得即便该认证根密钥并非由客户端所部署(预置或其他对象所部署),客户端也可以基于被公开 的公钥对该认证根密钥生成的签名进行验证。An authentication root key may be pre-deployed on the FPGA structure, and the authentication root key may be preset in the FPGA structure, or the authentication root key may be deployed into the FPGA structure by the client or other objects in an offline security environment. Wherein, the authentication root key is an asymmetric key, and the public key corresponding to the authentication root key is disclosed, so that even if the authentication root key is not deployed by the client (preset or deployed by other objects), the client The end can also verify the signature generated by the authentication root key based on the public key that is disclosed.
客户端可以与FPGA结构之间实现密钥协商。假定采用SM2(或其他算法)算法实现协商,客户端与FPGA结构需要在协商过程中实施至少一次信息交互:当FPGA结构向客户端发送协商信息时,可以采用上述的认证根密钥对该协商信息进行签名,使得客户端在收到签名后的协商信息后,可以利用被公开的公钥进行签名验证,从而确定该协商信息确实由FPGA结构发出,并信任该协商信息;而当签名未通过验证时,客户端可以选择不信任收到的协商信息。基于上述过程,客户端与FPGA结构可以完成密钥协商,使得客户端与FPGA结构可以分别获得相同的配置文件部署密钥。其中,该配置文件部署密钥可以由客户端与FPGA结构通过密钥协商过程直接得到,即该配置文件部署密钥可以为秘密值(或称,主密钥);或者,该配置文件部署密钥可由客户端与FPGA结构分别通过密钥导出函数从上述的秘密值导出得到。基于协商得到的配置文件部署密钥,客户端可以对上述的电路逻辑配置文件进行加密,并将加密后电路逻辑配置文件发送至FPGA结构;相应地,FPGA结构在收到加密后电路逻辑配置文件后,可以根据配置文件部署密钥进行解密得到相应的电路逻辑配置文件,并部署该电路逻辑配置文件。The client can realize key agreement with the FPGA structure. Assuming that the SM2 (or other algorithm) algorithm is used to realize the negotiation, the client and the FPGA structure need to implement at least one information exchange during the negotiation process: when the FPGA structure sends the negotiation information to the client, the above authentication root key can be used for the negotiation The information is signed, so that the client can use the public key to perform signature verification after receiving the signed negotiation information, so as to confirm that the negotiation information is indeed sent by the FPGA structure and trust the negotiation information; and when the signature fails During verification, the client can choose not to trust the received negotiation information. Based on the above process, the client and FPGA structure can complete key negotiation, so that the client and FPGA structure can obtain the same configuration file deployment key respectively. Among them, the configuration file deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the configuration file deployment key can be a secret value (or master key); or, the configuration file deployment key The key can be derived from the above-mentioned secret value through the key derivation function through the client and FPGA structure respectively. Based on the configuration file deployment key obtained through negotiation, the client can encrypt the above-mentioned circuit logic configuration file and send the encrypted circuit logic configuration file to the FPGA structure; accordingly, the FPGA structure receives the encrypted circuit logic configuration file Later, the corresponding circuit logic configuration file can be obtained by decrypting according to the configuration file deployment key, and the circuit logic configuration file can be deployed.
FPGA结构可以包括FPGA芯片,而FPGA结构在部署电路逻辑配置文件时,可以将电路逻辑配置文件直接读入FPGA芯片内。但是,FPGA芯片具有易失性,断电后部署的电路逻辑配置文件就会丢失,使得重新上电后需要客户端重新部署电路逻辑配置文件。因此,为了减少客户端的部署次数,FPGA结构可以进一步包含存储器,该存储器与FPGA芯片相连,使得电路逻辑配置文件被部署于存储器中,且FPGA芯片从存储器中读取电路逻辑配置文件以实现相关功能;其中,存储器具有非易失性,即便断电仍然可以保存电路逻辑配置文件,而重新上电后只需重新从存储器读入FPGA芯片即可,无需客户端重新部署。存储器可以具有多种形式,比如闪存等可重复擦写的非易失性存储器,再比如熔丝存储器等不可重复擦写的存储器等,本说明书并不对此进行限制。The FPGA structure may include an FPGA chip, and when the FPGA structure deploys a circuit logic configuration file, the circuit logic configuration file can be directly read into the FPGA chip. However, the FPGA chip is volatile, and the circuit logic configuration file deployed after the power is off will be lost, so that the client needs to re-deploy the circuit logic configuration file after power on. Therefore, in order to reduce the number of deployments of the client, the FPGA structure can further include a memory, which is connected to the FPGA chip, so that the circuit logic configuration file is deployed in the memory, and the FPGA chip reads the circuit logic configuration file from the memory to implement related functions ; Among them, the memory is non-volatile, even if the power is off, the circuit logic configuration file can still be saved, and after the power is turned on, it is only necessary to read the FPGA chip from the memory again, without the client re-deployment. The memory may have various forms, such as a non-volatile memory that can be re-erasable, such as flash memory, and a non-re-erasable memory, such as a fuse memory, which is not limited in this specification.
FPGA结构可以包括密钥管理芯片,前述的认证根密钥可以被存储于该密钥管理芯片中,以具备高安全性和高可靠度。当然,认证根密钥也可以存储于诸如前述的FPGA芯片或存储器中,本说明书并不对此进行限制。The FPGA structure may include a key management chip, and the aforementioned authentication root key may be stored in the key management chip to have high security and high reliability. Of course, the authentication root key can also be stored in the aforementioned FPGA chip or memory, which is not limited in this specification.
步骤204,所述FPGA结构通过已部署的认证根密钥对认证结果进行签名,所述认证结果包含与所述电路逻辑配置文件相关的内容,其中所述认证根密钥对应的公钥被公开。Step 204: The FPGA structure signs the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public key corresponding to the authentication root key is disclosed .
步骤206,所述FPGA结构将签名后的所述认证结果返回至所述客户端,以使所述 客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。In step 206, the FPGA structure returns the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result contains information related to the circuit logic configuration file In the case of the content, confirm that the circuit logic configuration file is successfully deployed on the FPGA structure.
如前所述,由于FPGA结构内部署的认证根密钥为非对称密钥,且该认证根密钥对应的公钥被公开,因而客户端可以提前获得该公钥,并据此针对FPGA结构返回的认证结果进行签名验证,并在签名验证通过的情况下确定该认证结果由FPGA结构提供且认证结果未被篡改。上述验证过程可由客户端在本地完成,而无需借助于第三方实现,一方面可以减少交互次数、提升验证效率,另一方面可以避免第三方的介入及交互次数的增加而造成额外的安全风险,确保验证结果的可靠性不依赖于第三方的自制力与可信度。As mentioned earlier, since the authentication root key deployed in the FPGA structure is an asymmetric key, and the public key corresponding to the authentication root key is disclosed, the client can obtain the public key in advance and target the FPGA structure accordingly. The returned authentication result is subjected to signature verification, and if the signature verification is passed, it is determined that the authentication result is provided by the FPGA structure and the authentication result has not been tampered with. The above verification process can be completed locally by the client without the need of a third party. On the one hand, it can reduce the number of interactions and improve the efficiency of verification. On the other hand, it can avoid the intervention of third parties and the increase in the number of interactions that may cause additional security risks. To ensure the reliability of the verification results does not depend on the self-control and credibility of a third party.
客户端可以对认证结果所含的与电路逻辑配置文件相关的内容进行验证,从而确定该内容与客户端向FPGA结构部署的电路逻辑配置文件是否一致。譬如上述与电路逻辑配置文件相关的内容可以为该电路逻辑配置文件的哈希值,或者采用预设算法(例如sm3算法等)对该电路逻辑配置文件的哈希值进行计算后的数值,使得客户端在已有上述电路逻辑配置文件、已知上述预设算法的情况下,可以在本地计算电路逻辑配置文件的哈希值或者采用上述预设算法对该哈希值进一步计算,并与认证结果包含的上述哈希值或数值进行比较:若一致,则表明FPGA结构正确地部署了客户端提供的电路逻辑配置文件,否则表明电路逻辑配置文件未配置成功。The client can verify the content related to the circuit logic configuration file contained in the authentication result, so as to determine whether the content is consistent with the circuit logic configuration file deployed by the client to the FPGA structure. For example, the above-mentioned content related to the circuit logic configuration file may be the hash value of the circuit logic configuration file, or the value obtained by calculating the hash value of the circuit logic configuration file using a preset algorithm (such as sm3 algorithm, etc.), so that In the case that the client has the above-mentioned circuit logic configuration file and the above-mentioned preset algorithm is known, it can calculate the hash value of the circuit logic configuration file locally or use the above-mentioned preset algorithm to further calculate the hash value, and verify it with The above-mentioned hash values or values contained in the result are compared: if they are consistent, it indicates that the FPGA structure correctly deploys the circuit logic configuration file provided by the client; otherwise, it indicates that the circuit logic configuration file is not configured successfully.
进一步地,上述的认证结果中还可以包含与配置文件部署密钥相关的内容。相应地,客户端可以根据自身导出的配置文件部署密钥对上述的认证结果进行验证。例如,认证结果中可以包含配置文件部署密钥的哈希值,或者采用预设算法对配置文件部署密钥或其哈希值进行计算得到的数值,那么与上述电路逻辑配置文件相类似的,客户端可以根据自身导出的配置文件部署密钥计算哈希值或与上述预设算法相关的数值:如果认证结果包含的与电路逻辑配置文件相关的内容、与配置文件部署密钥相关的内容均通过验证,则表明FPGA结构与客户端之间成功协商了配置文件部署密钥,并且FPGA结构正确地部署了客户端提供的电路逻辑配置文件,否则表明密钥协商失败或电路逻辑配置文件部署失败。再例如,认证结果中与电路逻辑配置文件相关的内容、与配置文件部署密钥相关的内容可以被生成为同一内容,即认证结果中可以包含一同时与电路逻辑配置文件、配置文件部署密钥相关的内容;比如,FPGA结构可以采用预设算法对所部署的电路逻辑配置文件(或其哈希值)、协商得到的配置文件部署密钥(或其哈希值)进行计算并得到一数值,以作为上述认证结果中同时与电路逻辑配置文件、配置文件部署密钥相关的内容,而客户端根据自身维护的电路逻辑配置文件、配置文件部署密钥和已知的上述 预设算法,即可对认证结果所含的数值进行验证。Further, the aforementioned authentication result may also include content related to the deployment key of the configuration file. Correspondingly, the client can verify the above-mentioned authentication result according to the deployment key of the configuration file exported by itself. For example, the authentication result can include the hash value of the configuration file deployment key, or the value obtained by calculating the configuration file deployment key or its hash value using a preset algorithm, which is similar to the above-mentioned circuit logic configuration file. The client can calculate the hash value or the value related to the above-mentioned preset algorithm according to the configuration file deployment key exported by itself: if the authentication result contains the content related to the circuit logic configuration file and the content related to the configuration file deployment key. Passing the verification indicates that the FPGA structure and the client have successfully negotiated the configuration file deployment key, and the FPGA structure has correctly deployed the circuit logic configuration file provided by the client, otherwise it indicates that the key negotiation failed or the circuit logic configuration file deployment failed . For another example, the content related to the circuit logic configuration file and the content related to the configuration file deployment key in the authentication result can be generated as the same content, that is, the authentication result can include a circuit logic configuration file and configuration file deployment key at the same time. Related content; for example, the FPGA structure can use a preset algorithm to calculate the deployed circuit logic configuration file (or its hash value) and the negotiated configuration file deployment key (or its hash value) to obtain a value , As the content related to the circuit logic configuration file and the configuration file deployment key in the above authentication result, and the client maintains the circuit logic configuration file, the configuration file deployment key and the known above-mentioned preset algorithm according to its own maintenance, namely The value contained in the certification result can be verified.
与上述配置文件部署密钥相类似的,客户端可与FPGA结构之间进行密钥协商,使得客户端与FPGA结构可以分别导出相同的业务秘密部署密钥,以用于将客户端提供的业务密钥或其他业务秘密部署至FPGA结构。其中,在密钥协商过程中,客户端与FPGA结构需要相互发送协商信息,而FPGA结构在生成协商信息后,可以通过前述的认证根密钥进行签名,并将签名后的协商信息发送至客户端,而客户端可以根据已公开的公钥进行签名验证:在签名通过验证后,客户端确定协商信息来自FPGA结构,并进一步基于该协商信息完成协商过程,否则客户端可以终止密钥协商。最终,客户端与FPGA结构经过协商后,可以分别获得相同的业务秘密部署密钥。其中,该业务秘密部署密钥可以由客户端与FPGA结构通过密钥协商过程直接得到,即该业务秘密部署密钥可以为秘密值(或称,主密钥);或者,该业务秘密部署密钥可由客户端与FPGA结构分别通过密钥导出函数从上述的秘密值导出得到。Similar to the configuration file deployment key mentioned above, the client can negotiate a key with the FPGA structure, so that the client and FPGA structure can respectively export the same business secret deployment key to use the service provided by the client The key or other business secrets are deployed to the FPGA structure. Among them, in the key negotiation process, the client and the FPGA structure need to send negotiation information to each other, and after the FPGA structure generates the negotiation information, it can sign with the aforementioned authentication root key, and send the signed negotiation information to the client The client can perform signature verification according to the public key that has been disclosed: after the signature is verified, the client determines that the negotiation information comes from the FPGA structure, and further completes the negotiation process based on the negotiation information, otherwise the client can terminate the key negotiation. Finally, the client and FPGA structure can obtain the same business secret deployment key after negotiation. Among them, the business secret deployment key can be directly obtained by the client and the FPGA structure through a key agreement process, that is, the business secret deployment key can be a secret value (or master key); or, the business secret deployment key The key can be derived from the above-mentioned secret value through the key derivation function through the client and FPGA structure respectively.
基于协商得到的业务秘密部署密钥,客户端可以对需要部署的业务密钥进行加密,并将加密后业务密钥发送至FPGA结构;相应地,FPGA结构在收到加密后业务密钥后,可以根据业务秘密部署密钥进行解密得到相应的业务密钥,并部署该业务密钥。Based on the negotiated business secret deployment key, the client can encrypt the business key that needs to be deployed and send the encrypted business key to the FPGA structure; accordingly, after the FPGA structure receives the encrypted business key, The corresponding service key can be obtained by decryption according to the service secret deployment key, and the service key can be deployed.
例如,业务密钥可以包括:节点私钥,该节点私钥对应的节点公钥被公开;其中,该节点公钥被用于对交易进行加密,或者该节点公钥与交易提交方提供的对称密钥被共同用于通过数字信封方式对交易进行加密。以区块链场景下的隐私交易为例,假定交易提交方希望对提交的交易内容保密,交易提交方可以通过上述的节点公钥对交易进行加密后提交至区块链节点,而区块链节点可以在FPGA结构中利用节点私钥进行解密,从而得到明文的交易内容;或者,交易提交方可以采用随机生成(或通过其他方式得到)的对称密钥对交易进行加密,在通过上述的节点公钥对该对称密钥进行加密,并将加密后交易和加密后对称密钥提交至区块链节点,而区块链节点可以在FPGA结构中利用节点私钥对加密后对称密钥进行解密,并通过解密得到的对称密钥对加密后交易进行解密,从而得到明文的交易内容。For example, the service key may include: the node private key, the node public key corresponding to the node private key is disclosed; where the node public key is used to encrypt the transaction, or the node public key is symmetrical with the transaction submitting party The key is commonly used to encrypt transactions through digital envelopes. Take the privacy transaction in the blockchain scenario as an example. Assuming that the transaction submitting party wants to keep the content of the submitted transaction confidential, the transaction submitting party can encrypt the transaction with the above-mentioned node public key and submit it to the blockchain node. The node can use the node's private key to decrypt in the FPGA structure to obtain the transaction content in plain text; or, the transaction submitting party can use a randomly generated (or obtained by other means) symmetric key to encrypt the transaction, and then pass through the above-mentioned node The public key encrypts the symmetric key, and submits the encrypted transaction and the encrypted symmetric key to the blockchain node, and the blockchain node can use the node private key in the FPGA structure to decrypt the encrypted symmetric key , And decrypt the encrypted transaction with the symmetric key obtained by decryption, so as to obtain the transaction content in plain text.
再例如,业务密钥可以包括:业务根密钥,该业务根密钥或该业务根密钥的衍生密钥用于对可信执行环境内产生的隐私数据进行加密后存储至区块链节点维护的数据库中。例如,区块链节点在FPGA结构所形成的TEE内执行交易后,可能产生存在加密需求的上述隐私数据,比如该隐私数据可以包括执行智能合约所产生的合约状态的取值,那么FPGA结构可以通过上述的业务根密钥或其衍生密钥对隐私数据进行加密,并将加 密后的隐私数据存储至区块链节点维护的数据库中。相应地,在需要读取该隐私数据时,通过将加密后的隐私数据读入FPGA结构中,使得FPGA结构可以基于上述的业务根密钥或其衍生密钥进行解密,即可得到相应明文的隐私数据,以便于读取或更新该隐私数据的数值,或将该隐私数据的数值用于参与其他计算过程等。For another example, the business key may include: the business root key, the business root key or the derived key of the business root key is used to encrypt the private data generated in the trusted execution environment and store it to the blockchain node Maintained in the database. For example, after a blockchain node executes a transaction in the TEE formed by the FPGA structure, the above-mentioned private data with encryption requirements may be generated. For example, the private data may include the value of the contract state generated by the execution of the smart contract, then the FPGA structure can The private data is encrypted by the business root key or its derived key, and the encrypted private data is stored in the database maintained by the blockchain node. Correspondingly, when the private data needs to be read, by reading the encrypted private data into the FPGA structure, the FPGA structure can be decrypted based on the business root key or its derivative key, and the corresponding plaintext can be obtained. Private data, so as to read or update the value of the private data, or use the value of the private data to participate in other calculation processes, etc.
客户端与FPGA结构可以通过两次协商过程,分别协商得到上述的配置文件部署密钥和业务秘密部署密钥。或者,客户端与FPGA结构可以通过一次协商过程,同时协商得到上述的配置文件部署密钥和业务秘密部署密钥;例如,客户端与FPGA结构可以协商得到相同的秘密值,然后通过上述的密钥导出函数导出配置文件部署密钥和业务秘密部署密钥,譬如密钥导出函数可以一次性导出32字节随机数,其中前16字节可作为配置文件部署密钥、后16字节可作为业务秘密部署密钥。The client and the FPGA structure can negotiate to obtain the above-mentioned configuration file deployment key and business secret deployment key through two negotiation processes. Or, the client and the FPGA structure can negotiate to obtain the above configuration file deployment key and business secret deployment key at the same time through a negotiation process; for example, the client and the FPGA structure can negotiate to obtain the same secret value, and then pass the above-mentioned secret value. The key export function exports the configuration file deployment key and the business secret deployment key. For example, the key export function can export a 32-byte random number at one time. The first 16 bytes can be used as the configuration file deployment key and the last 16 bytes can be used as the configuration file deployment key. Business secret deployment key.
图3是一示例性实施例提供的一种客户端与FPGA结构之间的交互过程的示意流程图。假定客户端可以为KMS服务器,FPGA结构被配置于区块链节点上,KMS服务器通过对该FPGA结构进行认证,从而在该FPGA结构通过认证的情况下,向FPGA结构部署区块链节点所需的业务密钥,以将该区块链节点配置为具备隐私功能,从而实现具备隐私功能的区块链网络。如图3所示,该方法可以包括以下步骤:Fig. 3 is a schematic flowchart of an interaction process between a client and an FPGA structure provided by an exemplary embodiment. Assuming that the client can be a KMS server, the FPGA structure is configured on the blockchain node, and the KMS server authenticates the FPGA structure, so that if the FPGA structure is authenticated, it is required to deploy the blockchain node to the FPGA structure To configure the blockchain node to have a privacy function, so as to realize a blockchain network with privacy function. As shown in Figure 3, the method may include the following steps:
步骤301,FPGA结构部署认证根密钥。Step 301, the FPGA structure deploys the authentication root key.
认证根密钥可由生产方在生产制造FPGA结构的过程中完成部署,即生产方将认证根密钥部署至FPGA结构,譬如部署至FPGA结构所含的密钥管理芯片内。The authentication root key can be deployed by the manufacturer in the process of manufacturing the FPGA structure, that is, the manufacturer deploys the authentication root key to the FPGA structure, for example, to the key management chip contained in the FPGA structure.
当然,认证根密钥也可以由客户端进行部署。例如,客户端对应的用户可以在离线状态下的物理安全环境中,将认证根密钥部署至FPGA结构中,譬如部署至上述的密钥管理芯片内。Of course, the authentication root key can also be deployed by the client. For example, the user corresponding to the client can deploy the authentication root key into the FPGA structure in a physical security environment in an offline state, for example, into the above-mentioned key management chip.
不论采用何种部署方式,FPGA结构中部署的认证根密钥均为非对称密钥,即该认证根密钥存在对应的认证公钥,而该认证公钥处于被公开状态。例如,可以提供某一网站,使得客户端可以对上述的认证公钥进行下载。No matter which deployment method is adopted, the authentication root key deployed in the FPGA structure is an asymmetric key, that is, the authentication root key has a corresponding authentication public key, and the authentication public key is in a public state. For example, a certain website can be provided so that the client can download the above-mentioned authentication public key.
步骤302,客户端与FPGA结构远程协商密钥。Step 302, the client and the FPGA structure remotely negotiate a key.
假定客户端与FPGA结构可以采用诸如SM2算法实现密钥协商。在协商过程中,客户端与FPGA结构需要分别生成协商信息,并对各自生成的协商信息进行远程交换,从而完成协商过程。其中,FPGA结构在生成协商信息后,可以通过上述的认证根密钥对该协商信息进行签名,然后将签名后的协商信息发送至客户端。相应地,客户端从远端 收到协商信息后,可以通过预先获得的认证公钥对该协商信息进行签名验证:如果验证成功,表明该协商信息确实来自于FPGA结构,即该协商信息可信,从而基于该协商信息完成后续的协商过程,否则终止密钥协商。可见,由于FPGA结构内置认证根密钥,且该认证根密钥对应的认证公钥处于公开状态,使得客户端与FPGA结构可以据此实现远程的密钥协商,并且客户端可以在本地完成签名验证,而无需借助于第三方,可以避免客户端与第三方之间的交互而导致验证效率降低,并且避免验证结果的可靠性依赖于第三方的可信度,有助于提升安全性。It is assumed that the client and FPGA structure can use algorithms such as SM2 to achieve key negotiation. In the negotiation process, the client and the FPGA structure need to generate negotiation information separately, and exchange the negotiation information generated by each other remotely, so as to complete the negotiation process. Wherein, after the FPGA structure generates the negotiation information, it can sign the negotiation information with the above authentication root key, and then send the signed negotiation information to the client. Correspondingly, after the client receives the negotiation information from the remote end, it can use the pre-obtained authentication public key to sign the negotiation information: if the verification is successful, it indicates that the negotiation information does come from the FPGA structure, that is, the negotiation information is credible , So as to complete the subsequent negotiation process based on the negotiation information, otherwise terminate the key negotiation. It can be seen that because the FPGA structure has a built-in authentication root key, and the authentication public key corresponding to the authentication root key is in the public state, the client and the FPGA structure can realize remote key negotiation based on this, and the client can complete the signature locally. Verification without resorting to a third party can prevent the interaction between the client and the third party from reducing the verification efficiency, and avoid the reliability of the verification result from relying on the credibility of the third party, which helps to improve security.
步骤303,客户端、FPGA结构分别导出配置文件部署密钥、业务秘密部署密钥。Step 303: The client and FPGA structure respectively export the configuration file deployment key and the business secret deployment key.
基于密钥协商操作,客户端与FPGA结构可以分别生成相同的秘密值,并进一步通过KDF函数对该秘密值进行处理,可以导出上述的配置文件部署密钥和业务秘密部署密钥。例如,KDF函数可以导出一组32字节的随机数,可以将前16字节随机数作为配置文件部署密钥、后16字节随机数作为业务秘密部署密钥;当然,KDF函数可以导出其他长度的随机数,并且每个密钥可以分别采用其他长度,本说明书并不对此进行限制。KDF函数导出的随机数也并不一定都用于生成业务密钥,比如KDF函数可以导出64字节的随机数,可以选取前16字节随机数作为配置文件部署密钥、后16字节随机数作为业务秘密部署密钥,剩余32字节随机数丢弃。Based on the key agreement operation, the client and the FPGA structure can respectively generate the same secret value, and further process the secret value through the KDF function, and can derive the above-mentioned configuration file deployment key and business secret deployment key. For example, the KDF function can derive a set of 32-byte random numbers, the first 16-byte random number can be used as the configuration file deployment key, and the last 16-byte random number can be used as the business secret deployment key; of course, the KDF function can derive other The length of the random number, and each key can use other lengths respectively, this specification does not limit this. The random numbers exported by the KDF function are not necessarily used to generate business keys. For example, the KDF function can export a 64-byte random number. The first 16-byte random number can be selected as the configuration file deployment key, and the last 16-byte random number can be selected as the configuration file deployment key. The number is used as the business secret deployment key, and the remaining 32 bytes of random numbers are discarded.
客户端和FPGA结构分别对导出的配置文件部署密钥、业务秘密部署密钥进行维护。其中,FPGA结构可以包括FPGA芯片和密钥管理芯片,其中配置文件部署密钥和业务秘密部署密钥可以被维护于密钥管理芯片中,以确保其安全性。The client and FPGA structure respectively maintain the exported configuration file deployment key and business secret deployment key. Wherein, the FPGA structure may include an FPGA chip and a key management chip, wherein the configuration file deployment key and the business secret deployment key can be maintained in the key management chip to ensure its security.
步骤304,客户端生成电路逻辑配置文件并加密,然后将加密后电路逻辑配置文件发送至FPGA结构。In step 304, the client generates and encrypts the circuit logic configuration file, and then sends the encrypted circuit logic configuration file to the FPGA structure.
客户端根据步骤303导出的配置文件部署密钥对电路逻辑配置文件进行加密,使得加密后电路逻辑配置文件被远程传输至FPGA结构的过程中,即便发生数据泄露也不会造成损失。The client encrypts the circuit logic configuration file according to the configuration file deployment key derived in step 303, so that when the encrypted circuit logic configuration file is remotely transmitted to the FPGA structure, no loss will be caused even if data leakage occurs.
步骤305,FPGA结构解密得到电路逻辑配置文件并部署。Step 305: Decrypt the FPGA structure to obtain the circuit logic configuration file and deploy it.
FPGA结构收到客户端发送的加密后电路逻辑配置文件后,可以利用步骤303中导出的配置文件部署密钥进行解密,得到明文的电路逻辑配置文件;然后,FPGA结构可以对明文的电路逻辑配置文件实施部署。After the FPGA structure receives the encrypted circuit logic configuration file sent by the client, it can use the configuration file deployment key exported in step 303 to decrypt to obtain the circuit logic configuration file in plain text; then, the FPGA structure can configure the circuit logic in plain text File implementation deployment.
FPGA结构可以包括FPGA芯片和flash芯片,电路逻辑配置文件可以被部署于flash 芯片中,这样FPGA芯片在每次上电后可以从flash芯片中读取和加载上述电路逻辑配置文件,并且断电后flash芯片内部署的电路逻辑配置文件不会丢失,无需客户端反复部署。The FPGA structure can include an FPGA chip and a flash chip. The circuit logic configuration file can be deployed in the flash chip, so that the FPGA chip can read and load the above circuit logic configuration file from the flash chip every time it is powered on, and after power off The circuit logic configuration files deployed in the flash chip will not be lost, and there is no need for repeated deployment by the client.
步骤306,FPGA结构生成认证结果并签名,然后将签名后的认证结果返回客户端。Step 306: The FPGA structure generates and signs the authentication result, and then returns the signed authentication result to the client.
在完成对电路逻辑配置文件的部署后,FPGA结构可以生成认证结果。例如,FPGA结构可以生成电路逻辑配置文件对应的哈希值,比如采用user_bitstream_hash表示;同时,FPGA结构可以为前述的配置文件部署密钥生成对应的哈希值,比如采用userbitkey_hash表示;然后,FPGA结构可以采用诸如sm3算法进行计算,譬如得到的计算结果为msg,且msg=sm3(user_bitstream_hash||userbitkey_hash),并将该msg信息添加至认证结果中。After completing the deployment of the circuit logic configuration file, the FPGA structure can generate the authentication result. For example, the FPGA structure can generate the hash value corresponding to the circuit logic configuration file, such as user_bitstream_hash; at the same time, the FPGA structure can generate the corresponding hash value for the aforementioned configuration file deployment key, such as userbitkey_hash; then, the FPGA structure For example, the sm3 algorithm can be used for calculation, for example, the obtained calculation result is msg, and msg=sm3 (user_bitstream_hash||userbitkey_hash), and the msg information is added to the authentication result.
FPGA结构还进一步根据前述的认证根密钥对生成的认证结果进行签名,从而将签名后的认证结果发送至客户端。The FPGA structure further signs the generated authentication result according to the aforementioned authentication root key, so as to send the signed authentication result to the client.
步骤307,客户端收到签名后的认证结果后,验证签名和认证内容。Step 307: After receiving the signed authentication result, the client verifies the signature and authentication content.
如前所述,客户端可以预先获得认证根密钥对应的认证公钥,使得客户端在收到签名后的认证结果后,可以基于该认证公钥进行签名验证。As mentioned above, the client can obtain the authentication public key corresponding to the authentication root key in advance, so that the client can perform signature verification based on the authentication public key after receiving the signed authentication result.
在签名通过验证后,客户端可以进一步对该认证结果所含的认证内容进行验证,该认证内容可以包括上述的msg信息。客户端可以利用sm3算法计算msg’=sm3(user_bitstream_hash’||userbitkey_hash’),其中:user_bitstream_hash’表示客户端本地维护的电路逻辑配置文件、userbitkey_hash’表示客户端本地维护的配置文件部署密钥。那么,如果计算得到msg=msg’,表明客户端与FPGA结构在步骤303中成功协商了配置文件部署密钥,并且表明FPGA结构对客户端提供的电路逻辑配置文件实施了成功部署;其中,由于配置文件部署密钥与业务秘密部署密钥是基于同一秘密值导出,因而同样表明两者成功协商了业务秘密部署密钥。After the signature is verified, the client may further verify the authentication content contained in the authentication result, and the authentication content may include the aforementioned msg information. The client can use the sm3 algorithm to calculate msg’=sm3(user_bitstream_hash’||userbitkey_hash’), where: user_bitstream_hash’ represents the circuit logic configuration file maintained locally by the client, and userbitkey_hash’ represents the configuration file deployment key maintained locally by the client. Then, if msg=msg' is calculated, it indicates that the client and the FPGA structure have successfully negotiated the configuration file deployment key in step 303, and that the FPGA structure has successfully deployed the circuit logic configuration file provided by the client; The configuration file deployment key and the business secret deployment key are derived based on the same secret value, which also indicates that the two successfully negotiated the business secret deployment key.
因此,客户端可以在本地完成对认证结果的验证,而无需依赖于第三方,可以减少交互、提升安全性。Therefore, the client can complete the verification of the authentication result locally without relying on a third party, which can reduce interaction and improve security.
步骤308,客户端确定节点私钥、业务根密钥并加密,然后将加密后的节点私钥和业务根密钥发送至FPGA结构。In step 308, the client determines and encrypts the node private key and the service root key, and then sends the encrypted node private key and the service root key to the FPGA structure.
步骤309,FPGA结构解密得到节点私钥和业务根密钥。Step 309: Decrypt the FPGA structure to obtain the node private key and the service root key.
客户端采用步骤303得到的业务秘密部署密钥对节点私钥、业务根密钥等业务密钥进行加密后,使得客户端可以将节点私钥和业务根密钥安全地远程传输至FPGA结构;相应的,FPGA结构可以基于步骤303得到的业务秘密部署密钥进行解密,即可获得节点私钥和业务根密钥,并针对节点私钥和业务根密钥进行部署。After the client uses the service secret deployment key obtained in step 303 to encrypt service keys such as the node private key and the service root key, the client can safely and remotely transmit the node private key and the service root key to the FPGA structure; Correspondingly, the FPGA structure can be decrypted based on the service secret deployment key obtained in step 303 to obtain the node private key and the service root key, and deploy the node private key and the service root key.
基于FPGA结构上部署的节点私钥和业务根密钥,区块链节点可以基于FPGA结构实现隐私交易功能。例如,图4是一示例性实施例提供的一种区块链节点对交易进行处理的示意图。如图4所示,区块链节点包括左侧的常规执行环境和右侧由FPGA结构形成的TEE,用户提交的交易首先进入常规执行环境中的“交易调度”接口进行类型识别,将识别出的明文交易留在常规执行环境中进行处理(对应于左侧的“交易执行”环节),而将识别出的隐私交易传递至TEE中进行处理(对应于右侧的“交易执行”环节)。Based on the node private key and business root key deployed on the FPGA structure, the blockchain node can realize the privacy transaction function based on the FPGA structure. For example, FIG. 4 is a schematic diagram of a blockchain node processing transactions provided by an exemplary embodiment. As shown in Figure 4, the blockchain node includes the conventional execution environment on the left and the TEE formed by the FPGA structure on the right. The transaction submitted by the user first enters the "transaction scheduling" interface in the conventional execution environment for type identification, and will identify The plaintext transactions of ”are left in the regular execution environment for processing (corresponding to the "transaction execution" link on the left), and the identified private transactions are passed to the TEE for processing (corresponding to the "transaction execution" link on the right).
隐私交易由用户加密后提交至区块链节点。例如,用户可以随机产生对称密钥,而FPGA结构上部署的节点私钥存在已公开的节点公钥,使得用户可以基于该对称密钥和节点公钥对交易内容实施数字信封加密:用户采用对称密钥对明文的交易内容进行加密、生成加密后交易内容,并采用节点公钥对该对称密钥进行加密、生成加密后对称密钥,然后将加密后交易内容和加密后对称密钥作为隐私交易同时提交至区块链节点。相应地,区块链节点将隐私交易读入FPGA结构中,通过FPGA结构中部署的节点私钥对加密后对称密钥进行解密、得到对称密钥,并进一步基于该对称密钥对加密后交易内容进行解密、得到明文的交易内容,然后在FPGA结构上处理该交易内容。The private transaction is encrypted by the user and submitted to the blockchain node. For example, the user can randomly generate a symmetric key, and the node private key deployed on the FPGA structure has a public node public key, so that the user can implement digital envelope encryption on the transaction content based on the symmetric key and the node public key: the user adopts symmetric The key encrypts the transaction content of the plaintext, generates the encrypted transaction content, uses the node public key to encrypt the symmetric key, generates the encrypted symmetric key, and then uses the encrypted transaction content and the encrypted symmetric key as privacy The transaction is submitted to the blockchain node at the same time. Correspondingly, the blockchain node reads the private transaction into the FPGA structure, decrypts the encrypted symmetric key through the node private key deployed in the FPGA structure, obtains the symmetric key, and further encrypts the transaction based on the symmetric key The content is decrypted to obtain the transaction content in plain text, and then the transaction content is processed on the FPGA structure.
其中,隐私交易可以理解为存在隐私需求的交易;除了隐私交易之外,区块链节点可能接收到明文交易,明文交易为不存在隐私需求的交易。隐私需求可以通过多种方式予以表达,本说明书并不对此进行限制。例如,每笔交易可以包含类型字段,该类型字段用于标注相应的交易属于隐私交易还是明文交易。如前所述,区块链节点可以在如图1所示的常规执行环境中的“交易调度”接口识别交易类型。在相关技术中,例如在以太坊网络中,交易通常包含to、value、data等字段;而本实施例在相关技术的基础上,在交易中增加一类型字段,比如表征为type字段,并基于该类型字段的取值,表明相关交易的类型:例如,当类型字段为第一取值时,表明相关交易为明文交易,当类型字段为第二取值时,表明相关交易为隐私交易。再例如,用户可以在创建交易的过程中在交易内添加加密标识,以表达上述的隐私需求。那么,当检查到交易中包含加密标识时,区块链节点可以判定该交易为隐私交易,否则判定该交易为明文交易。又例如,区 块链节点可以识别交易所需调用的智能合约的类型,当被调用的智能合约属于隐私类型(比如智能合约包含隐私标识,或者智能合约的代码中包括隐私标识标注的合约状态等)时,可以判定该交易属于隐私交易,否则判定该交易为明文交易。Among them, privacy transactions can be understood as transactions that have privacy requirements; in addition to privacy transactions, blockchain nodes may receive plaintext transactions, which are transactions that do not require privacy. Privacy requirements can be expressed in a variety of ways, and this manual does not limit this. For example, each transaction may include a type field, which is used to indicate whether the corresponding transaction is a private transaction or a plaintext transaction. As mentioned earlier, the blockchain node can identify the transaction type in the "transaction scheduling" interface in the conventional execution environment as shown in Figure 1. In related technologies, for example, in the Ethereum network, transactions usually contain fields such as to, value, and data; and this embodiment adds a type field to the transaction on the basis of related technologies, such as a type field, and based on The value of the type field indicates the type of the related transaction: for example, when the type field is the first value, it indicates that the related transaction is a plaintext transaction, and when the type field is the second value, it indicates that the related transaction is a private transaction. For another example, the user can add an encrypted identifier to the transaction in the process of creating a transaction to express the aforementioned privacy requirements. Then, when it is checked that the transaction contains an encrypted identifier, the blockchain node can determine that the transaction is a private transaction, otherwise it is determined that the transaction is a plaintext transaction. For another example, the blockchain node can identify the type of smart contract called for the transaction, when the called smart contract belongs to the privacy type (for example, the smart contract contains a privacy identifier, or the code of the smart contract includes the contract status marked by the privacy identifier, etc. ), the transaction can be determined to be a private transaction, otherwise the transaction is determined to be a plaintext transaction.
本说明书中的交易可以用于实现相对简单的处理逻辑,比如类似于相关技术中的转账逻辑。此时无论是上述的明文交易或隐私交易,均可与智能合约无关。The transactions in this specification can be used to implement relatively simple processing logic, for example, similar to the transfer logic in related technologies. At this time, whether it is the above-mentioned plaintext transaction or private transaction, it can not be related to the smart contract.
本说明书中的交易还可以用于实现相对复杂的处理逻辑,这里可以借助于上述的智能合约来实现。以以太坊为例,支持用户在以太坊网络中创建和/或调用一些复杂的逻辑,这是以太坊区别于比特币区块链技术的最大挑战。以太坊作为一个可编程区块链的核心是以太坊虚拟机(EVM),每个以太坊节点都可以运行EVM。EVM是一个图灵完备的虚拟机,这意味着可以通过它实现各种复杂的逻辑。用户在以太坊中发布和调用智能合约就是在EVM上运行的。如图4所示,通过在常规执行环境中部署EVM,可以通过该EVM执行明文交易发布或调用的智能合约,以实现常规执行环境中的“交易执行”环节;以及,通过在TEE中部署EVM(FPGA结构基于部署的电路逻辑配置文件,可以实现EVM或其他虚拟机的功能),可以通过该EVM执行隐私交易发布或调用的智能合约,以实现TEE中的“交易执行”环节。The transactions in this specification can also be used to implement relatively complex processing logic, which can be implemented here with the help of the above-mentioned smart contract. Taking Ethereum as an example, supporting users to create and/or call some complex logic in the Ethereum network is the biggest challenge that distinguishes Ethereum from Bitcoin blockchain technology. The core of Ethereum as a programmable blockchain is the Ethereum Virtual Machine (EVM), and every Ethereum node can run EVM. EVM is a Turing complete virtual machine, which means that various complex logic can be implemented through it. Users who publish and call smart contracts in Ethereum run on the EVM. As shown in Figure 4, by deploying the EVM in the conventional execution environment, the smart contract issued or called by the plaintext transaction can be executed through the EVM to realize the "transaction execution" link in the conventional execution environment; and, by deploying the EVM in the TEE (The FPGA structure is based on the deployed circuit logic configuration file, which can realize the functions of EVM or other virtual machines). The smart contract issued or called by the private transaction can be executed through the EVM to realize the "transaction execution" link in the TEE.
隐私交易在FPGA结构中完成处理后,可能导致相关账户的账户余额或者智能合约相关的合约状态的取值发生变化,而FPGA结构可以基于前述的业务根密钥或其衍生密钥对这些取值进行加密,并将加密后的取值存入区块链节点维护的数据库中。After the private transaction is processed in the FPGA structure, the account balance of the relevant account or the value of the contract state related to the smart contract may change, and the FPGA structure can be based on the aforementioned business root key or its derivative key to obtain these values. Encryption is performed, and the encrypted value is stored in the database maintained by the blockchain node.
因此,只有在FPGA结构内的数据可以呈现为明文状态,以实现高效的数据处理,而FPGA结构之外的数据均处于加密状态,以确保数据安全性,从而能够实现区块链上的隐私保护功能。Therefore, only the data in the FPGA structure can be presented in plaintext state to achieve efficient data processing, while the data outside the FPGA structure are all in an encrypted state to ensure data security, thereby enabling privacy protection on the blockchain Features.
图5是一示例性实施例提供的一种设备的示意结构图。请参考图5,在硬件层面,该设备包括处理器502、内部总线504、网络接口506、内存508以及非易失性存储器510,当然还可能包括其他业务所需要的硬件。处理器502从非易失性存储器510中读取对应的计算机程序到内存508中然后运行,在逻辑层面上形成基于FPGA实现隐私区块链的装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 5. At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510. Of course, it may also include hardware required for other services. The processor 502 reads the corresponding computer program from the non-volatile memory 510 to the memory 508 and then runs it to form an FPGA-based device for implementing a privacy blockchain at the logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each The logic unit can also be a hardware or a logic device.
请参考图6,在软件实施方式中,该基于FPGA实现隐私区块链的装置可以包 括:Please refer to Fig. 6, in the software implementation, the FPGA-based device for implementing a privacy blockchain may include:
配置文件部署单元61,使客户端向区块链节点处的FPGA结构部署电路逻辑配置文件,所述电路逻辑配置文件用于使所述FPGA结构实现为所述区块链节点的可信执行环境;The configuration file deployment unit 61 enables the client to deploy a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment for the blockchain node ;
认证结果接收单元62,使所述客户端接收所述FPGA结构返回的认证结果,所述认证结果由所述FPGA结构内部署的认证根密钥进行签名,且所述认证根密钥对应的公钥被公开;The authentication result receiving unit 62 enables the client to receive the authentication result returned by the FPGA structure, the authentication result being signed by the authentication root key deployed in the FPGA structure, and the publicity corresponding to the authentication root key Key is made public;
部署确认单元63,使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The deployment confirmation unit 63 enables the client to confirm that the circuit logic configuration file is in the FPGA structure when the authentication result passes the signature verification and the authentication result contains content related to the circuit logic configuration file. The deployment is successful.
可选的,所述认证根密钥被预置于所述FPGA结构中;或者,所述认证根密钥由所述客户端或其他对象在离线安全环境下部署至所述FPGA结构中。Optionally, the authentication root key is preset in the FPGA structure; or, the authentication root key is deployed into the FPGA structure by the client or other objects in an offline security environment.
可选的,配置文件部署单元61具体用于:Optionally, the configuration file deployment unit 61 is specifically configured to:
使所述客户端根据所述FPGA结构发送的协商信息,与所述FPGA结构协商配置文件部署密钥,使所述客户端与所述FPGA结构分别确定出所述配置文件部署密钥;其中,所述协商信息由所述认证根密钥进行签名;The client is allowed to negotiate a configuration file deployment key with the FPGA structure according to the negotiation information sent by the FPGA structure, so that the client and the FPGA structure respectively determine the configuration file deployment key; wherein, The negotiation information is signed by the authentication root key;
使所述客户端通过所述配置文件部署密钥对所述电路逻辑配置文件进行加密,并将加密后电路逻辑配置文件发送至所述FPGA结构,使所述FPGA结构根据所述配置文件部署密钥进行解密并部署所述电路逻辑配置文件。Make the client encrypt the circuit logic configuration file by using the configuration file deployment key, and send the encrypted circuit logic configuration file to the FPGA structure, so that the FPGA structure deploys the password according to the configuration file. Key to decrypt and deploy the circuit logic configuration file.
可选的,所述认证结果中还包含与所述配置文件部署密钥相关的内容。Optionally, the authentication result also includes content related to the configuration file deployment key.
可选的,还包括:Optionally, it also includes:
业务密钥协商单元64,使所述客户端根据所述FPGA结构发送的协商信息,与所述FPGA结构协商业务秘密部署密钥,使所述客户端与所述FPGA结构分别确定出所述业务秘密部署密钥;其中,所述协商信息由所述认证根密钥进行签名;The service key agreement unit 64 enables the client to negotiate a service secret deployment key with the FPGA structure according to the negotiation information sent by the FPGA structure, so that the client and the FPGA structure respectively determine the service Secret deployment key; wherein the negotiation information is signed by the authentication root key;
业务密钥部署单元65,使所述客户端通过所述业务秘密部署密钥对业务密钥进行加密,并将加密后业务密钥发送至所述FPGA结构,使所述FPGA结构根据所述业务秘密部署密钥进行解密并部署所述业务密钥。The service key deployment unit 65 enables the client to encrypt the service key through the service secret deployment key, and sends the encrypted service key to the FPGA structure so that the FPGA structure is based on the service The secret deployment key performs decryption and deploys the service key.
可选的,所述业务密钥包括:节点私钥,所述节点私钥对应的节点公钥被公开;Optionally, the service key includes: a node private key, and the node public key corresponding to the node private key is disclosed;
其中,所述节点公钥被用于对交易进行加密;或者,所述节点公钥与交易提交方提供的对称密钥被共同用于通过数字信封方式对交易进行加密。Wherein, the node public key is used to encrypt the transaction; or, the node public key and the symmetric key provided by the transaction submitting party are jointly used to encrypt the transaction through a digital envelope.
可选的所述业务密钥包括:业务根密钥,所述业务根密钥或所述业务根密钥的衍生密钥用于对所述可信执行环境内产生的隐私数据进行加密后存储至所述区块链节点维护的数据库中。Optionally, the service key includes: a service root key, and the service root key or a derivative key of the service root key is used to encrypt and store the private data generated in the trusted execution environment To the database maintained by the blockchain node.
可选的,所述客户端包括密钥管理服务器。Optionally, the client includes a key management server.
图7是一示例性实施例提供的一种设备的示意结构图。请参考图7,在硬件层面,该设备包括处理器702、内部总线704、网络接口706、内存708以及非易失性存储器710,当然还可能包括其他业务所需要的硬件。处理器702从非易失性存储器710中读取对应的计算机程序到内存708中然后运行,在逻辑层面上形成基于FPGA实现隐私区块链的装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Fig. 7 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 7. At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710. Of course, it may also include hardware required for other services. The processor 702 reads the corresponding computer program from the non-volatile memory 710 to the memory 708 and then runs it to form an FPGA-based device for implementing a privacy blockchain at the logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each The logic unit can also be a hardware or a logic device.
请参考图8,在软件实施方式中,该基于FPGA实现隐私区块链的装置可以包括:Please refer to FIG. 8. In the software implementation, the FPGA-based device for implementing a privacy blockchain may include:
配置文件部署单元81,使FPGA结构对来自客户端的电路逻辑配置文件进行部署,所述电路逻辑配置文件用于使所述FPGA结构实现为所属的区块链节点上的可信执行环境;The configuration file deployment unit 81 enables the FPGA structure to deploy the circuit logic configuration file from the client, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
认证结果签名单元82,使所述FPGA结构通过已部署的认证根密钥对认证结果进行签名,所述认证结果包含与所述电路逻辑配置文件相关的内容,其中所述认证根密钥对应的公钥被公开;The authentication result signing unit 82 enables the FPGA structure to sign the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, wherein the authentication root key corresponds to The public key is made public;
认证结果返回单元83,使所述FPGA结构将签名后的所述认证结果返回至所述客户端,以使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The authentication result returning unit 83 enables the FPGA structure to return the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes the same as the circuit In the case of content related to the logic configuration file, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
可选的,所述认证根密钥被预置于所述FPGA结构中;或者,所述认证根密钥由所述客户端或其他对象在离线安全环境下部署至所述FPGA结构中。Optionally, the authentication root key is preset in the FPGA structure; or, the authentication root key is deployed into the FPGA structure by the client or other objects in an offline security environment.
可选的,所述FPGA结构包括密钥管理芯片,所述认证根密钥被存储于所述密钥管理芯片中。Optionally, the FPGA structure includes a key management chip, and the authentication root key is stored in the key management chip.
可选的,所述FPGA结构包括FPGA芯片和存储器;其中,所述电路逻辑配置文件被部署于所述存储器中,且所述FPGA芯片从所述存储器中读取所述电路逻辑配置文件以实现相关功能。Optionally, the FPGA structure includes an FPGA chip and a memory; wherein the circuit logic configuration file is deployed in the memory, and the FPGA chip reads the circuit logic configuration file from the memory to implement Related functions.
可选的,所述存储器包括非易失性存储器或熔丝存储器。Optionally, the memory includes a non-volatile memory or a fuse memory.
可选的,配置文件部署单元81具体用于:Optionally, the configuration file deployment unit 81 is specifically configured to:
使所述FPGA结构通过向所述客户端发送协商信息,与所述客户端协商配置文件部署密钥,使所述客户端与所述FPGA结构分别确定出所述配置文件部署密钥;其中,所述协商信息由所述认证根密钥进行签名;Make the FPGA structure negotiate a configuration file deployment key with the client by sending negotiation information to the client, so that the client and the FPGA structure respectively determine the configuration file deployment key; wherein, The negotiation information is signed by the authentication root key;
使所述FPGA结构接收所述客户端发送的加密后电路逻辑配置文件,所述加密后电路逻辑配置文件由所述配置文件部署密钥对所述电路逻辑配置文件进行加密得到;Enabling the FPGA structure to receive the encrypted circuit logic configuration file sent by the client, where the encrypted circuit logic configuration file is obtained by encrypting the circuit logic configuration file by the configuration file deployment key;
使所述FPGA结构根据所述文件部署密钥对所述加密后电路逻辑配置文件进行解密,并对解密得到的电路逻辑配置文件进行部署。The FPGA structure decrypts the encrypted circuit logic configuration file according to the file deployment key, and deploys the decrypted circuit logic configuration file.
可选的,所述认证结果中还包含与所述配置文件部署密钥相关的内容。Optionally, the authentication result also includes content related to the configuration file deployment key.
可选的,还包括:Optionally, it also includes:
协商单元84,使所述FPGA结构通过向所述客户端发送协商信息,与所述客户端协商配置业务秘密部署密钥,使所述客户端与所述FPGA结构分别确定出所述业务秘密部署密钥;其中,所述协商信息由所述认证根密钥进行签名;The negotiation unit 84 enables the FPGA structure to negotiate with the client to configure the service secret deployment key by sending negotiation information to the client, so that the client and the FPGA structure respectively determine the service secret deployment Key; wherein the negotiation information is signed by the authentication root key;
接收单元85,使所述FPGA结构接收所述客户端发送的加密后业务密钥,所述加密后业务密钥由所述业务秘密部署密钥对所述业务密钥进行加密得到;The receiving unit 85 enables the FPGA structure to receive the encrypted service key sent by the client, where the encrypted service key is obtained by encrypting the service key by the service secret deployment key;
解密单元86,使所述FPGA结构根据所述业务秘密部署密钥对所述加密后业务密钥进行解密,并对解密得到的业务密钥进行部署。The decryption unit 86 enables the FPGA structure to decrypt the encrypted service key according to the service secret deployment key, and deploy the decrypted service key.
可选的,所述业务密钥包括:节点私钥,所述节点私钥对应的节点公钥被公开;Optionally, the service key includes: a node private key, and the node public key corresponding to the node private key is disclosed;
其中,所述节点公钥被用于对交易进行加密;或者,所述节点公钥与交易提交方提供的对称密钥被共同用于通过数字信封方式对交易进行加密。Wherein, the node public key is used to encrypt the transaction; or, the node public key and the symmetric key provided by the transaction submitting party are jointly used to encrypt the transaction through a digital envelope.
可选的,所述业务密钥包括:业务根密钥,所述业务根密钥或所述业务根密钥的衍生密钥用于对所述可信执行环境内产生的隐私数据进行加密后存储至所述区块链节点维护的数据库中。Optionally, the service key includes: a service root key, and the service root key or a derived key of the service root key is used to encrypt private data generated in the trusted execution environment Stored in the database maintained by the blockchain node.
可选的,所述客户端包括密钥管理服务器。Optionally, the client includes a key management server.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, devices, modules, or units explained in the above embodiments may be implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or they also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理 也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that, although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to determination".
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The foregoing descriptions are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. All within the spirit and principle of one or more embodiments of this specification, Any modification, equivalent replacement, improvement, etc. made should be included in the protection scope of one or more embodiments of this specification.

Claims (25)

  1. 一种基于FPGA实现隐私区块链的方法,包括:A method for implementing a privacy blockchain based on FPGA includes:
    客户端向区块链节点处的FPGA结构部署电路逻辑配置文件,所述电路逻辑配置文件用于使所述FPGA结构实现为所述区块链节点的可信执行环境;The client deploys a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment of the blockchain node;
    所述客户端接收所述FPGA结构返回的认证结果,所述认证结果由所述FPGA结构内部署的认证根密钥进行签名,且所述认证根密钥对应的公钥被公开;The client receives the authentication result returned by the FPGA structure, the authentication result is signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key is made public;
    所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The client confirms that the circuit logic configuration file is successfully deployed on the FPGA structure when the authentication result passes the signature verification and the authentication result includes content related to the circuit logic configuration file.
  2. 根据权利要求1所述的方法,所述认证根密钥被预置于所述FPGA结构中;或者,所述认证根密钥由所述客户端或其他对象在离线安全环境下部署至所述FPGA结构中。According to the method of claim 1, the authentication root key is preset in the FPGA structure; or, the authentication root key is deployed by the client or other objects in the offline security environment to the In the FPGA structure.
  3. 根据权利要求1所述的方法,所述客户端向区块链节点处的FPGA结构部署电路逻辑配置文件,包括:The method according to claim 1, wherein the deployment of the circuit logic configuration file by the client to the FPGA structure at the blockchain node comprises:
    所述客户端根据所述FPGA结构发送的协商信息,与所述FPGA结构协商配置文件部署密钥,使所述客户端与所述FPGA结构分别确定出所述配置文件部署密钥;其中,所述协商信息由所述认证根密钥进行签名;The client negotiates a configuration file deployment key with the FPGA structure according to the negotiation information sent by the FPGA structure, so that the client and the FPGA structure respectively determine the configuration file deployment key; The negotiation information is signed by the authentication root key;
    所述客户端通过所述配置文件部署密钥对所述电路逻辑配置文件进行加密,并将加密后电路逻辑配置文件发送至所述FPGA结构,使所述FPGA结构根据所述配置文件部署密钥进行解密并部署所述电路逻辑配置文件。The client encrypts the circuit logic configuration file by using the configuration file deployment key, and sends the encrypted circuit logic configuration file to the FPGA structure, so that the FPGA structure deploys the key according to the configuration file Decrypt and deploy the circuit logic configuration file.
  4. 根据权利要求3所述的方法,所述认证结果中还包含与所述配置文件部署密钥相关的内容。The method according to claim 3, wherein the authentication result further includes content related to the deployment key of the configuration file.
  5. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    所述客户端根据所述FPGA结构发送的协商信息,与所述FPGA结构协商业务秘密部署密钥,使所述客户端与所述FPGA结构分别确定出所述业务秘密部署密钥;其中,所述协商信息由所述认证根密钥进行签名;The client negotiates the business secret deployment key with the FPGA structure according to the negotiation information sent by the FPGA structure, so that the client and the FPGA structure determine the business secret deployment key; The negotiation information is signed by the authentication root key;
    所述客户端通过所述业务秘密部署密钥对业务密钥进行加密,并将加密后业务密钥发送至所述FPGA结构,使所述FPGA结构根据所述业务秘密部署密钥进行解密并部署所述业务密钥。The client encrypts the service key by using the service secret deployment key, and sends the encrypted service key to the FPGA structure, so that the FPGA structure decrypts and deploys according to the service secret deployment key The service key.
  6. 根据权利要求5所述的方法,所述业务密钥包括:节点私钥,所述节点私钥对应的节点公钥被公开;The method according to claim 5, wherein the service key comprises: a node private key, and the node public key corresponding to the node private key is disclosed;
    其中,所述节点公钥被用于对交易进行加密;或者,所述节点公钥与交易提交方提 供的对称密钥被共同用于通过数字信封方式对交易进行加密。Wherein, the node public key is used to encrypt the transaction; or, the node public key and the symmetric key provided by the transaction submitting party are jointly used to encrypt the transaction by means of a digital envelope.
  7. 根据权利要求5所述的方法,所述业务密钥包括:业务根密钥,所述业务根密钥或所述业务根密钥的衍生密钥用于对所述可信执行环境内产生的隐私数据进行加密后存储至所述区块链节点维护的数据库中。The method according to claim 5, wherein the service key comprises: a service root key, and the service root key or a derived key of the service root key is used to verify data generated in the trusted execution environment The private data is encrypted and stored in the database maintained by the blockchain node.
  8. 根据权利要求1所述的方法,所述客户端包括密钥管理服务器。The method of claim 1, wherein the client includes a key management server.
  9. 一种基于FPGA实现隐私区块链的方法,包括:A method for implementing a privacy blockchain based on FPGA includes:
    FPGA结构对来自客户端的电路逻辑配置文件进行部署,所述电路逻辑配置文件用于使所述FPGA结构实现为所属的区块链节点上的可信执行环境;The FPGA structure deploys a circuit logic configuration file from the client, and the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
    所述FPGA结构通过已部署的认证根密钥对认证结果进行签名,所述认证结果包含与所述电路逻辑配置文件相关的内容,其中所述认证根密钥对应的公钥被公开;The FPGA structure signs the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public key corresponding to the authentication root key is disclosed;
    所述FPGA结构将签名后的所述认证结果返回至所述客户端,以使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The FPGA structure returns the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes content related to the circuit logic configuration file In this case, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
  10. 根据权利要求9所述的方法,所述认证根密钥被预置于所述FPGA结构中;或者,所述认证根密钥由所述客户端或其他对象在离线安全环境下部署至所述FPGA结构中。According to the method of claim 9, the authentication root key is pre-placed in the FPGA structure; or, the authentication root key is deployed by the client or other objects in the offline security environment to the In the FPGA structure.
  11. 根据权利要求9所述的方法,所述FPGA结构包括密钥管理芯片,所述认证根密钥被存储于所述密钥管理芯片中。The method according to claim 9, wherein the FPGA structure includes a key management chip, and the authentication root key is stored in the key management chip.
  12. 根据权利要求9所述的方法,所述FPGA结构包括FPGA芯片和存储器;其中,所述电路逻辑配置文件被部署于所述存储器中,且所述FPGA芯片从所述存储器中读取所述电路逻辑配置文件以实现相关功能。The method according to claim 9, wherein the FPGA structure includes an FPGA chip and a memory; wherein the circuit logic configuration file is deployed in the memory, and the FPGA chip reads the circuit from the memory Logical configuration files to achieve related functions.
  13. 根据权利要求12所述的方法,所述存储器包括非易失性存储器或熔丝存储器。The method according to claim 12, the memory comprises a non-volatile memory or a fuse memory.
  14. 根据权利要求9所述的方法,所述FPGA结构对来自客户端的电路逻辑配置文件进行部署,包括:The method according to claim 9, wherein the FPGA structure deploys the circuit logic configuration file from the client, comprising:
    所述FPGA结构通过向所述客户端发送协商信息,与所述客户端协商配置文件部署密钥,使所述客户端与所述FPGA结构分别确定出所述配置文件部署密钥;其中,所述协商信息由所述认证根密钥进行签名;The FPGA structure negotiates the configuration file deployment key with the client by sending negotiation information to the client, so that the client and the FPGA structure respectively determine the configuration file deployment key; The negotiation information is signed by the authentication root key;
    所述FPGA结构接收所述客户端发送的加密后电路逻辑配置文件,所述加密后电路逻辑配置文件由所述配置文件部署密钥对所述电路逻辑配置文件进行加密得到;The FPGA structure receives the encrypted circuit logic configuration file sent by the client, and the encrypted circuit logic configuration file is obtained by encrypting the circuit logic configuration file by the configuration file deployment key;
    所述FPGA结构根据所述文件部署密钥对所述加密后电路逻辑配置文件进行解密,并对解密得到的电路逻辑配置文件进行部署。The FPGA structure decrypts the encrypted circuit logic configuration file according to the file deployment key, and deploys the circuit logic configuration file obtained by decryption.
  15. 根据权利要求14所述的方法,所述认证结果中还包含与所述配置文件部署密钥相关的内容。The method according to claim 14, wherein the authentication result further includes content related to the deployment key of the configuration file.
  16. 根据权利要求9所述的方法,还包括:The method according to claim 9, further comprising:
    所述FPGA结构通过向所述客户端发送协商信息,与所述客户端协商配置业务秘密部署密钥,使所述客户端与所述FPGA结构分别确定出所述业务秘密部署密钥;其中,所述协商信息由所述认证根密钥进行签名;The FPGA structure sends negotiation information to the client, and negotiates with the client to configure the service secret deployment key, so that the client and the FPGA structure respectively determine the service secret deployment key; wherein, The negotiation information is signed by the authentication root key;
    所述FPGA结构接收所述客户端发送的加密后业务密钥,所述加密后业务密钥由所述业务秘密部署密钥对所述业务密钥进行加密得到;The FPGA structure receives the encrypted service key sent by the client, and the encrypted service key is obtained by encrypting the service key by the service secret deployment key;
    所述FPGA结构根据所述业务秘密部署密钥对所述加密后业务密钥进行解密,并对解密得到的业务密钥进行部署。The FPGA structure decrypts the encrypted service key according to the service secret deployment key, and deploys the decrypted service key.
  17. 根据权利要求16所述的方法,所述业务密钥包括:节点私钥,所述节点私钥对应的节点公钥被公开;The method according to claim 16, wherein the service key comprises: a node private key, and the node public key corresponding to the node private key is disclosed;
    其中,所述节点公钥被用于对交易进行加密;或者,所述节点公钥与交易提交方提供的对称密钥被共同用于通过数字信封方式对交易进行加密。Wherein, the node public key is used to encrypt the transaction; or, the node public key and the symmetric key provided by the transaction submitting party are jointly used to encrypt the transaction through a digital envelope.
  18. 根据权利要求16所述的方法,所述业务密钥包括:业务根密钥,所述业务根密钥或所述业务根密钥的衍生密钥用于对所述可信执行环境内产生的隐私数据进行加密后存储至所述区块链节点维护的数据库中。The method according to claim 16, wherein the service key comprises: a service root key, and the service root key or a derived key of the service root key is used to verify data generated in the trusted execution environment The private data is encrypted and stored in the database maintained by the blockchain node.
  19. 根据权利要求9所述的方法,所述客户端包括密钥管理服务器。The method of claim 9, wherein the client includes a key management server.
  20. 一种基于FPGA实现隐私区块链的装置,包括:A device for implementing a privacy blockchain based on FPGA, including:
    配置文件部署单元,使客户端向区块链节点处的FPGA结构部署电路逻辑配置文件,所述电路逻辑配置文件用于使所述FPGA结构实现为所述区块链节点的可信执行环境;The configuration file deployment unit enables the client to deploy a circuit logic configuration file to the FPGA structure at the blockchain node, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment for the blockchain node;
    认证结果接收单元,使所述客户端接收所述FPGA结构返回的认证结果,所述认证结果由所述FPGA结构内部署的认证根密钥进行签名,且所述认证根密钥对应的公钥被公开;The authentication result receiving unit enables the client to receive the authentication result returned by the FPGA structure, the authentication result being signed by the authentication root key deployed in the FPGA structure, and the public key corresponding to the authentication root key Be made public
    部署确认单元,使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。A confirmation unit is deployed to enable the client to confirm that the circuit logic configuration file is on the FPGA structure when the authentication result passes the signature verification and the authentication result contains content related to the circuit logic configuration file The deployment was successful.
  21. 一种基于FPGA实现隐私区块链的装置,包括:A device for implementing a privacy blockchain based on FPGA, including:
    配置文件部署单元,使FPGA结构对来自客户端的电路逻辑配置文件进行部署,所述电路逻辑配置文件用于使所述FPGA结构实现为所属的区块链节点上的可信执行环境;The configuration file deployment unit enables the FPGA structure to deploy the circuit logic configuration file from the client, where the circuit logic configuration file is used to implement the FPGA structure as a trusted execution environment on the blockchain node to which it belongs;
    认证结果签名单元,使所述FPGA结构通过已部署的认证根密钥对认证结果进行签名,所述认证结果包含与所述电路逻辑配置文件相关的内容,其中所述认证根密钥对应的公钥被公开;The authentication result signing unit causes the FPGA structure to sign the authentication result through the deployed authentication root key, the authentication result includes content related to the circuit logic configuration file, and the public authentication root key corresponds to the authentication result. Key is made public;
    认证结果返回单元,使所述FPGA结构将签名后的所述认证结果返回至所述客户端,以使所述客户端在所述认证结果通过签名验证且所述认证结果包含与所述电路逻辑配置文件相关的内容的情况下,确认所述电路逻辑配置文件在所述FPGA结构上部署成功。The authentication result returning unit is configured to enable the FPGA structure to return the signed authentication result to the client, so that the client passes the signature verification on the authentication result and the authentication result includes the circuit logic In the case of configuration file-related content, it is confirmed that the circuit logic configuration file is successfully deployed on the FPGA structure.
  22. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-8中任一项所述的方法。Wherein, the processor implements the method according to any one of claims 1-8 by running the executable instruction.
  23. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-8中任一项所述方法的步骤。A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implements the steps of the method according to any one of claims 1-8.
  24. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求9-19中任一项所述的方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 9-19.
  25. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求9-19中任一项所述方法的步骤。A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 9-19.
PCT/CN2020/097358 2019-09-25 2020-06-22 Fpga-based privacy block chain implementing method and device WO2021057124A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910913460.6 2019-09-25
CN201910913460.6A CN110716724B (en) 2019-09-25 2019-09-25 Method and device for realizing privacy block chain based on FPGA

Publications (1)

Publication Number Publication Date
WO2021057124A1 true WO2021057124A1 (en) 2021-04-01

Family

ID=69210883

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097358 WO2021057124A1 (en) 2019-09-25 2020-06-22 Fpga-based privacy block chain implementing method and device

Country Status (2)

Country Link
CN (1) CN110716724B (en)
WO (1) WO2021057124A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255263A (en) * 2021-06-07 2021-08-13 上海国微思尔芯技术股份有限公司 Particle band dividing method, device, computer equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110716724B (en) * 2019-09-25 2021-01-08 支付宝(杭州)信息技术有限公司 Method and device for realizing privacy block chain based on FPGA
CN112231652B (en) * 2020-10-28 2022-02-22 百度在线网络技术(北京)有限公司 Trusted environment remote verification method, device, equipment, system and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272240A (en) * 2007-03-21 2008-09-24 华为技术有限公司 Conversation cryptographic key generation method, system and communication equipment
CN109792386A (en) * 2016-09-29 2019-05-21 诺基亚技术有限公司 Method and apparatus for trust computing
WO2019120315A2 (en) * 2019-03-26 2019-06-27 Alibaba Group Holding Limited Field-programmable gate array based trusted execution environment for use in a blockchain network
CN110086659A (en) * 2019-04-12 2019-08-02 苏州浪潮智能科技有限公司 A kind of security update System and method for of FPGA configuration file
CN110716724A (en) * 2019-09-25 2020-01-21 支付宝(杭州)信息技术有限公司 Method and device for realizing privacy block chain based on FPGA

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9230091B2 (en) * 2012-06-20 2016-01-05 Microsoft Technology Licensing, Llc Managing use of a field programmable gate array with isolated components
US10528765B2 (en) * 2016-09-16 2020-01-07 Intel Corporation Technologies for secure boot provisioning and management of field-programmable gate array images
US10880071B2 (en) * 2018-02-23 2020-12-29 Samsung Electronics Co., Ltd. Programmable blockchain solid state drive and switch
CN110417558B (en) * 2018-06-28 2022-12-09 腾讯科技(深圳)有限公司 Signature verification method and device, storage medium and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272240A (en) * 2007-03-21 2008-09-24 华为技术有限公司 Conversation cryptographic key generation method, system and communication equipment
CN109792386A (en) * 2016-09-29 2019-05-21 诺基亚技术有限公司 Method and apparatus for trust computing
WO2019120315A2 (en) * 2019-03-26 2019-06-27 Alibaba Group Holding Limited Field-programmable gate array based trusted execution environment for use in a blockchain network
CN110086659A (en) * 2019-04-12 2019-08-02 苏州浪潮智能科技有限公司 A kind of security update System and method for of FPGA configuration file
CN110716724A (en) * 2019-09-25 2020-01-21 支付宝(杭州)信息技术有限公司 Method and device for realizing privacy block chain based on FPGA

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255263A (en) * 2021-06-07 2021-08-13 上海国微思尔芯技术股份有限公司 Particle band dividing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110716724A (en) 2020-01-21
CN110716724B (en) 2021-01-08

Similar Documents

Publication Publication Date Title
WO2021103794A1 (en) Method for realizing highly efficient privacy-preserving transaction in blockchain, and device
US11405372B2 (en) Retrieving access data for blockchain networks using highly available trusted execution environments
WO2021179743A1 (en) Method and apparatus for querying account privacy information in blockchain
WO2021184963A1 (en) Contract calling method and apparatus
CN113221169B (en) Method and device for inquiring block chain private data
CN111541724B (en) Block chain all-in-one machine and automatic node adding method and device thereof
JP2020528224A (en) Secure execution of smart contract operations in a reliable execution environment
TW202113645A (en) Managing a smart contract on a blockchain
WO2021057181A1 (en) Fpga-based key negotiation method and device
CN111541552B (en) Block chain all-in-one machine and automatic node adding method and device thereof
CN110580245B (en) Private data sharing method and device
WO2020233631A1 (en) Transaction type-based receipt storage method and node
WO2021057124A1 (en) Fpga-based privacy block chain implementing method and device
WO2021057182A1 (en) Trusted update method and apparatus for fpga logic
WO2021057180A1 (en) Fpga-based privacy blockchain implementation method, and device
WO2021057168A1 (en) Method and apparatus for realizing virtual machine operation on the basis of fpga
WO2020233633A1 (en) Receipt storage method and node based on determination condition
WO2021057272A1 (en) Method and apparatus for implementing contract invoking based on fpga
WO2021057221A1 (en) Method and apparatus for realizing state update based on fpga
WO2021057273A1 (en) Method and apparatus for realizing efficient contract calling on fpga
WO2021057141A1 (en) Pipelined instruction reading method and apparatus based on fpga
WO2021031087A1 (en) Certificate management method and apparatus
CN114866409B (en) Password acceleration method and device based on password acceleration hardware

Legal Events

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

Ref document number: 20867225

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20867225

Country of ref document: EP

Kind code of ref document: A1