> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/seismic-solidity/shielded-types.md).

# Shielded Types

A handle on stype unlocks all shielded computation and storage

Operations on shielded types return shielded types. For example, comparing two `suint256` values produces an `sbool`, not a `bool`. Arithmetic on `sint256` returns `sint256`, and so on.

## Shielded Integers

All comparisons and operators for shielded integers are functionally identical to their unshielded counterparts.

### suint - Shielded Unsigned Integer

```
suint256 a = suint256(10);
suint256 b = suint256(3);

// == EXAMPLES
a > b   // sbool(true)
a | b   // suint256(11)
a << 2  // suint256(40)
a % b   // suint256(1)
```

### sint - Shielded Signed Integer

```
sint256 a = sint256(-10);
sint256 b = sint256(3);

// == EXAMPLES
a < b   // sbool(true)
a + b   // sint256(-7)
a * b   // sint256(-30)
```

## sbool - Shielded Boolean

All comparisons and operators for `sbool` function identically to `bool`.

We recommend reading the point on [conditional execution](/seismic-solidity/footguns.md#conditional-execution) prior to using `sbool` since it's easy to accidentally leak information with this type.

```
sbool a = sbool(true);
sbool b = sbool(false);

// == EXAMPLES
a && b  // sbool(false)
!b      // sbool(true)
```

## saddress - Shielded Address

An `saddress` variable supports `code` and `codehash` members only. Members like `call`, `delegatecall`, `staticcall`, `balance`, and `transfer` are not available — you must cast to `address` first.

```
saddress a = saddress(0x123);
saddress b = saddress(0x456);

// == VALID EXAMPLES
a == b  // sbool(false)
b.code
b.codehash

// == INVALID EXAMPLES
a.balance   // must cast to address first
a.call("")  // must cast to address first
```

## sbytes - Shielded Bytes

### Fixed-size: sbytes1 through sbytes32

Fixed-size shielded bytes mirror the standard `bytes1`–`bytes32` types.

```
sbytes32 a = sbytes32(0xabcd);
sbytes1 b = sbytes1(0xff);
```

### Dynamic: sbytes

Dynamic shielded bytes mirror the standard `bytes` type. The length is stored as shielded — like [dynamic shielded arrays](/seismic-solidity/collections.md#shielded-arrays), observers cannot read it directly but may infer an upper bound from gas costs.

## Shielded Literals

You can create shielded integer constants with either an explicit cast or the `s` suffix:

```
suint256 a = suint256(42);   // explicit cast
suint256 b = 42s;            // s suffix — same result
```

The `s` suffix infers the shielded type from context and works with hex, underscores, scientific notation, and unary minus. See [Shielded Literals](/seismic-solidity/shielded-literals.md) for the full specification.

{% hint style="warning" %}
Both forms embed the literal value in the contract bytecode, which is publicly visible — the initial value is leaked at deployment time. The compiler emits warning 9660 to remind you.

This is fine for values meant to be public initially and then evolve through private state changes. But if the literal itself is sensitive, do not hardcode it. See [Footguns](/seismic-solidity/footguns.md#literals) for more detail.
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.seismic.systems/seismic-solidity/shielded-types.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
