Storage
Ciphertexts in fhEVM-native are stored onchain in the storage of a predefined contract that has no code and is used just for ciphertexts. At the time of writing, its address is 0x5e.
Contract storage in the EVM is a key-value store. For ciphertexts, we use the handle as a key and the value is the actual ciphertext.
Furthermore, stored ciphertexts are immutable, making ciphertext storage append-only.
Ciphertexts can be read by anyone. We expose the GetCiphertext
function on the FheLib
precompiled contract. Nodes/validators must support it.
GetCiphertext Function (selector: ff627e77)
The GetCiphertext
function returns a serialized TFHE ciphertext given:
the ebool/e(u)int value (also called a handle) for which the ciphertext is requested
GetCiphertext only works via the eth_call
RPC.
To call GetCiphertext via eth_call
, the following Python can serve as an example:
Last updated
Was this helpful?