Precompiles
Precompile are MEVM contracts that are implemented in native code instead of bytecode. Precompiles additionally can communicate with internal APIs. Currently the MEVM supports all existing Ethereum Precompiles up to Dencun, and introduces four new classes of precompiles:
- offchain computation that is too expensive in solidity
- calls to API methods to interact with the Confidential Data Store
- calls to
suavex
API Methods to interact with Domain-Specific Services - calls to retrieve context for the confidential compute requests
Available Precompilesβ
A list of available precompiles in Rigil are as follows:
IsConfidential
β
Address: 0x0000000000000000000000000000000042010000
Determines if the current execution mode is regular (onchain) or confidential. Outputs a boolean value.
function isConfidential() internal view returns (bool b)
ConfidentialInputs
β
Address: 0x0000000000000000000000000000000042010001
Provides the confidential inputs associated with a confidential computation request. Outputs are in bytes format.
function confidentialInputs() internal view returns (bytes memory)
ConfidentialStore
β
Address: 0x0000000000000000000000000000000042020000
Handles the storage of data in the confidential store. Requires the caller to be part of the AllowedPeekers
for the associated bid.
function confidentialStore(DataId dataId, string memory key, bytes memory data1) internal view
ConfidentialRetrieve
β
Address: 0x0000000000000000000000000000000042020001
Retrieves data from the confidential store. Also mandates the caller's presence in the AllowedPeekers
list.
function confidentialRetrieve(DataId dataId, string memory key) internal view returns (bytes memory)
NewDataRecord
β
Address: 0x0000000000000000000000000000000042030000
Initializes data records within the ConfidentialStore. AllowedPeekers
specifies which addresses can "get" data. AllowedStores
specifies which addresses can "set" data. Prior to storing data, all bids should undergo initialization via this precompile.
function newDataRecord(uint64 decryptionCondition, address[] memory allowedPeekers, address[] memory allowedStores, string memory dataType)