Skip to content Skip to footer

EVMs and Sapphire

Ethereum’s Virtual Machine (EVM): Storage and Computation

Let’s delve into how the Ethereum network handles data storage.

As mentioned earlier, Ethereum employs a world state, essentially a vast tree data structure. Each node in this tree consists of a 32-byte key paired with a 32-byte value. This structure applies to all data stored on the network, including transactions and variables within smart contracts.

Every piece of data, whether a transaction or a variable in a smart contract, is associated with an address derived from the contract address and the specific location within the smart contract. The value itself is constrained to 32 bytes; to store larger values, consecutive nodes must be concatenated and combined.

Given the public nature of blockchain data, it’s feasible to extract the complete storage of any contract. This leads to the crucial question: Wouldn’t it be beneficial to encrypt data for privacy?

Indeed, the idea of encrypting data on the blockchain seems promising. However, a challenge arises concerning the encryption key. If a smart contract encrypts data, it must determine which key to use. Storing this key on the blockchain poses a significant security risk, as it would be visible to everyone, compromising the data’s confidentiality. Thus, the dilemma persists: How can data be encrypted securely on the blockchain without exposing the encryption key? 

Let’s delve into how the Ethereum network handles data storage.

As mentioned earlier, Ethereum employs a world state, essentially a vast tree data structure. Each node in this tree consists of a 32-byte key paired with a 32-byte value. This structure applies to all data stored on the network, including transactions and variables within smart contracts.

Every piece of data, whether a transaction or a variable in a smart contract, is associated with an address derived from the contract address and the specific location within the smart contract. The value itself is constrained to 32 bytes; to store larger values, consecutive nodes must be concatenated and combined.

Given the public nature of blockchain data, it’s feasible to extract the complete storage of any contract. This leads to the crucial question: Wouldn’t it be beneficial to encrypt data for privacy?

Indeed, the idea of encrypting data on the blockchain seems promising. However, a challenge arises concerning the encryption key. If a smart contract encrypts data, it must determine which key to use. Storing this key on the blockchain poses a significant security risk, as it would be visible to everyone, compromising the data’s confidentiality. Thus, the dilemma persists: How can data be encrypted securely on the blockchain without exposing the encryption key?

What should a Confidential EVM Look Like?

Let’s delve into how the Ethereum network handles data storage.

As mentioned earlier, Ethereum employs a world state, essentially a vast tree data structure. Each node in this tree consists of a 32-byte key paired with a 32-byte value. This structure applies to all data stored on the network, including transactions and variables within smart contracts.

Every piece of data, whether a transaction or a variable in a smart contract, is associated with an address derived from the contract address and the specific location within the smart contract. The value itself is constrained to 32 bytes; to store larger values, consecutive nodes must be concatenated and combined.

Given the public nature of blockchain data, it’s feasible to extract the complete storage of any contract. This leads to the crucial question: Wouldn’t it be beneficial to encrypt data for privacy?

Indeed, the idea of encrypting data on the blockchain seems promising. However, a challenge arises concerning the encryption key. If a smart contract encrypts data, it must determine which key to use. Storing this key on the blockchain poses a significant security risk, as it would be visible to everyone, compromising the data’s confidentiality. Thus, the dilemma persists: How can data be encrypted securely on the blockchain without exposing the encryption key?

 With the integration of a confidential dApp and a distributed network, the hardware setup remains largely unchanged. However, the web Gateway now requires extended capabilities to access confidential primitives securely.

In terms of communication, HTTP requests still serve as the primary means, but they are wrapped in encryption due to the implementation of peer-to-peer encryption. This ensures end-to-end security between nodes, bolstering data confidentiality.

The most significant evolution lies in the computation process, which now occurs within the trusted execution environment on each node. When executing smart contracts or transactions, this computation takes place within the secure enclave of the TEE. Consequently, node operators are unable to extract any information regarding the operations performed by the smart contract or the data involved.

This paradigm shift sets the stage for innovations like the Sapphire Confidential EVM. This advanced execution environment enhances privacy and security within distributed networks, empowering users with unprecedented control over their data and operations.

Sapphire Confidential EVM

The whole introduction I made results in Sapphire. 

The integration of the Ethereum Virtual Machine (EVM) with the Sapphire platform marks a significant advancement in blockchain technology. Smart contracts deployed on Sapphire are executed within trusted execution environments, ensuring enhanced privacy and security.

One notable feature of Sapphire is its encrypted storage capability, which safeguards data stored on nodes. While data may be publicly accessible, it remains encrypted, preserving confidentiality.

To ensure compatibility with existing Ethereum smart contracts, Sapphire supports both encrypted and unencrypted transactions. This flexibility allows users to choose whether to utilize end-to-end encryption based on their privacy requirements.

It’s important to note that opting for unencrypted transactions does not compromise the safety of computations performed within the trusted execution environment. Rather, it provides users with the freedom to select the level of privacy and security that best suits their needs.

Overall, Sapphire offers a versatile and secure platform for executing Ethereum smart contracts, with encryption features designed to enhance data protection and privacy.