> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/a16z/jolt/llms.txt
> Use this file to discover all available pages before exploring further.

# TrustedAdvice<T>

> A wrapper type to mark guest program inputs as trusted advice in Jolt zkVM

## Overview

`TrustedAdvice<T>` is a wrapper type that marks guest program inputs as trusted advice. Trusted advice values are assumed to be correct and do not require verification within the zkVM. This is useful for inputs that are inherently verifiable or when the correctness of the input is guaranteed by external means.

## Type Definition

```rust theme={null}
pub struct TrustedAdvice<T> {
    value: T,
}
```

<ResponseField name="value" type="T">
  The wrapped value provided as trusted advice
</ResponseField>

## Methods

### new

Creates a new `TrustedAdvice` wrapper around a value.

```rust theme={null}
pub fn new(value: T) -> Self
```

<ParamField path="value" type="T" required>
  The value to wrap as trusted advice
</ParamField>

**Returns:** A new `TrustedAdvice<T>` instance

**Example:**

```rust theme={null}
use jolt_sdk::TrustedAdvice;

let trusted_value = TrustedAdvice::new(42u64);
```

## Trait Implementations

### `From<T>`

Allows automatic conversion from any value `T` into `TrustedAdvice<T>`.

```rust theme={null}
impl<T> From<T> for TrustedAdvice<T>
```

**Example:**

```rust theme={null}
use jolt_sdk::TrustedAdvice;

let trusted: TrustedAdvice<u64> = 42u64.into();
```

### Deref

Provides automatic dereferencing to access the wrapped value.

```rust theme={null}
impl<T> core::ops::Deref for TrustedAdvice<T> {
    type Target = T;
}
```

**Example:**

```rust theme={null}
use jolt_sdk::TrustedAdvice;

let trusted = TrustedAdvice::new(42u64);
let value: u64 = *trusted; // Dereferences to 42
```

## Usage Example

```rust theme={null}
use jolt_sdk::TrustedAdvice;

#[jolt::provable]
fn process_trusted_data(data: TrustedAdvice<Vec<u64>>) -> u64 {
    // The zkVM assumes this data is correct and doesn't verify it
    data.iter().sum()
}

fn main() {
    let data = vec![1, 2, 3, 4, 5];
    let result = process_trusted_data(TrustedAdvice::new(data));
    println!("Sum: {}", result);
}
```

## When to Use

Use `TrustedAdvice<T>` when:

* The input is guaranteed to be correct by external verification
* The correctness of the input can be verified through other computations in your program
* You want to reduce proof generation overhead by not verifying certain inputs

<Warning>
  Improperly using `TrustedAdvice` can compromise the security of your zkVM program. Only use it for values whose correctness is guaranteed or will be verified elsewhere in your computation.
</Warning>

## See Also

* [UntrustedAdvice\<T>](/api/types/untrusted-advice) - For advice that requires verification
* [AdviceWriter](/api/types/advice-writer) - Writing advice data to the advice tape
* [AdviceReader](/api/types/advice-reader) - Reading advice data from the advice tape
