Skip to main content
Version: v0.36.0

Oracles

Experimental Feature

This feature is experimental. The documentation may be incomplete or out of date, which means it could change in future versions, potentially causing unexpected behavior or not working as expected.

Contributions Welcome: If you notice any inaccuracies or potential improvements, please consider contributing. Visit our GitHub repository to make your contributions: Contribute Here.

Noir has support for Oracles via RPC calls. This means Noir will make an RPC call and use the return value for proof generation.

Since Oracles are not resolved by Noir, they are unconstrained functions

You can declare an Oracle through the #[oracle(<name>)] flag. Example:

#[oracle(get_number_sequence)]
unconstrained fn get_number_sequence(_size: Field) -> [Field] {}

The timeout for when using an external RPC oracle resolver can be set with the NARGO_FOREIGN_CALL_TIMEOUT environment variable. This timeout is in units of milliseconds.