Safe key update technology in blockchain
Glossary
Term definitionBlockchain nodeParticipants in the blockchain network, responsible for verifying and storing data. Smart contractA contract that can be triggered by transactions on the blockchain system. Trusted Execution Environment (TEE)A trusted execution environment that is completely isolated from the outside world based on the security extension of CPU hardware. Software Guard Extensions (SGX)A TEE technology launched by Intel that provides memory encryption technology and limits trusted hardware to the CPU. EnclaveAn encrypted trusted execution area in the memory provided by SGX technology, where the CPU protects data from being stolen. EPC (Enclave Page Cache)Enclave page cache, an area in the CPU used to store encrypted data. MEE (Memory Encryption Engine)Memory encryption engine, used to encrypt data in the EPC. Remote attestationA mechanism for confirming the authenticity of the TEE in TEE technology, endorsed by the hardware manufacturer and using digital signature technology to ensure that the user can verify the status of the TEE. Key management serverA server responsible for generating and managing keys. seal key (Simple Encrypted Arithmetic Library)A symmetric encryption key used to encrypt data in SGX. Version factors are used to generate parameters for different versions of security keys and are associated with version numbers. Contract states are data generated during the operation of smart contracts and stored on the blockchain. Impact factors are used to generate parameters for different keys and can be private or public. Private impact factors apply only to the corresponding contract state and not to the impact factors of other contract states. Public impact factors apply to the impact factors of all contract states at the same time. Key-Value Pair A data storage structure that indexes the corresponding value by key. Short answer questions
What is a Trusted Execution Environment (TEE)? Why is TEE important in blockchain privacy protection?
How does Intel's Software Guard Extensions (SGX) use enclaves to protect data security?
Please explain the necessity of security key version updates and explain how to update versions securely.
Why do you need to encrypt the keys corresponding to contract states?
Please explain the difference between private impact factors and public impact factors and give examples.
Why do you need to use different keys to encrypt different contract states?
Briefly describe the advantages of executing storage function code outside the trusted execution environment.
What are read cache and write cache? What role do they play in blockchain privacy protection?
Please explain how to generate other versions of keys from the seal key and explain the advantages of this approach.
What role does the key management server play in blockchain privacy protection?
Answer
A trusted execution environment (TEE) is a secure area isolated from the main processor that provides confidentiality and integrity of code and data even if the operating system or hypervisor is compromised. TEE is crucial in blockchain privacy protection because it can perform privacy-required calculations in a secure environment and prevent unauthorized access to sensitive data.
Intel's Software Guard Extensions (SGX) uses isolated memory areas called enclaves to protect data security. Enclaves are protected by the CPU and cannot be accessed even by the operating system or hypervisor. Data is encrypted before entering the enclave and decrypted within the enclave for calculation. The calculation results are encrypted before leaving the enclave, ensuring the confidentiality of the data.
The necessity of secure key version updates is that using the same key for a long time increases the risk of the key being cracked. Secure version updates can be achieved in the following way: using a higher version key can calculate a lower version key, but not vice versa. Therefore, it is possible to start with a lower version key and only allow updates to a higher version. In this way, even if the lower version key is lost, it can be upgraded to a higher version without affecting the security of the data.
The key corresponding to the contract state needs to be encrypted because the unencrypted key may leak information about the contract state, even if the contract state itself is encrypted. An attacker can infer sensitive information about the contract state by analyzing the pattern and frequency of the key, thereby compromising privacy.
Private influencing factors only apply to specific contract states, while public influencing factors apply to all contract states. For example, the order in which the contract states appear in a smart contract can be used as a private influencing factor because it is unique to each contract state. And the block height of the transaction can be used as a public influencing factor because it applies to all transactions in the same block.
Using different keys to encrypt different contract states separately can achieve more fine-grained privacy protection. Even if the key of one contract state is cracked, it will not affect the security of other contract states. This prevents attackers from inferring sensitive information by analyzing the relationship between different contract states.
The advantage of executing storage function code outside the trusted execution environment is that it can leverage existing storage technology and infrastructure without modifying the trusted execution environment. This can simplify the development process and reduce the risk of introducing vulnerabilities due to modifying the trusted execution environment.
Read cache and write cache are mechanisms used to improve data access efficiency. Read cache stores frequently accessed data to reduce the number of times data is read from external memory. Write cache stores data to be written to external memory to reduce the number of write operations. In blockchain privacy protection, read cache and write cache can store encrypted data to reduce the number of encryption and decryption operations, thereby improving performance.
Other versions of keys can be generated by hashing the seal key with the version factor. For example, a version 255 key can be generated using a version factor of 0xFF, a version 254 key can be generated using a version factor of 0xFE, and so on. The advantage of this approach is that a high version key can calculate a low version key, but not vice versa. This makes key management more flexible and improves security.
The key management server plays a vital role in blockchain privacy protection. It is responsible for generating and managing keys and securely distributing keys to authorized users. The security and reliability of the key management server directly affects the security of the entire blockchain system.
Essay question
Discuss in detail the advantages and disadvantages of using a trusted execution environment (TEE) for privacy protection in blockchain.
Compare and contrast privacy protection schemes based on transaction level, contract level and contract state level, and analyze their advantages and disadvantages and applicable scenarios.
Explore how to design a secure key management scheme to ensure the confidentiality and integrity of data in the blockchain.
Analyze the possibilities and challenges of combining trusted execution environment (TEE) with other privacy protection technologies (such as homomorphic encryption, zero-knowledge proof, etc.).
Discuss the development trends and challenges of blockchain privacy protection technology in practical applications.