> For the complete documentation index, see [llms.txt](https://docs.snarkify.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snarkify.io/sirius-folding/sirius-folding-apis/stepcircuit-trait.md).

# \`StepCircuit\` trait

Check [Terminologies](/sirius-folding/terminologies.md#step-circuit) first.

Also, due to the support of the halo2 ecosystem, you can learn more [Terminologies](/sirius-folding/terminologies.md#circuit) development from the [halo2 book](https://zcash.github.io/halo2/).&#x20;

#### Trait

```rust
pub trait StepCircuit<const ARITY: usize, F: PrimeField> {
    type Config: Clone;

    fn configure(cs: &mut ConstraintSystem<F>) -> Self::Config;

    fn synthesize_step(
        &self,
        config: Self::Config,
        layouter: &mut impl Layouter<F>,
        z_i: &[AssignedCell<F, F>; ARITY],
    ) -> Result<[AssignedCell<F, F>; ARITY], SynthesisError>;

    fn process_step(
        &self,
        z_i: &[F; ARITY],
        k_table_size: u32,
    ) -> Result<[F; ARITY], SynthesisError>;
}
```

* `const ARITY: usize` - Each step of [\`IVC\` struct](/sirius-folding/sirius-folding-apis/ivc-struct.md)has an input and an output (`z_in`, `z_out`), this parameter determines the size of this input.
* `type Config`- This type stores information about which columns and challenges we need for the circuit.
* `fn configure`- The function should create Config, as well as create all gates.\
  \
  Gadgets and chips from halo2 can be reused in this method.
* `fn synthesize_step` - Directly synthesize the witness, at this stage the PLONKish table must be filled in using `Layouter`.\
  \
  Gadgets and chips from halo2 can be reused in this method.
* `fn process_step` (optional for implementation) - This function must do the same `F(z_in) -> z_out` as `synthesize_step`. Due to some restrictions, we must supply as one of the public inputs (instance column) inside the folding scheme a hash that depends on `z_out`. \
  \
  By default, this method is done through the `synthesize_step` call, however, if the synthesis is long, it is possible to optimize it through a manual implementation in the off-circuit mode.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snarkify.io/sirius-folding/sirius-folding-apis/stepcircuit-trait.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
