> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Feature flags

> Enable or disable specific SDK behaviors using feature flags when initializing Portal.

## Overview

The `PortalFeatureFlags` class is used to configure feature flags when initializing the Portal SDK. Each flag corresponds to a specific feature or behavior that can be toggled on or off. All flags are optional and immutable after initialization — they cannot be changed at runtime.

## Enabling feature flags

Pass `featureFlags` when calling `portal.initialize()`:

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

await portal.initialize(
  apiKey: 'CLIENT_API_KEY_OR_CLIENT_SESSION_TOKEN',
  featureFlags: PortalFeatureFlags(
    useEnclaveMpcApi: true,
  ),
);
```

## Available flags

### `useEnclaveMpcApi`

* **Type:** `bool?`
* **Default:** `null` (disabled)
* **Description:** Enables the use of the **Enclave MPC API** for signing transactions. When enabled, MPC operations are executed server-side in a secure AWS Nitro Enclave, ensuring consistent and faster signing times.

**How it works**

Executing MPC operations on client devices can lead to inconsistent signing times due to variations in device CPU performance. By enabling the `useEnclaveMpcApi` flag, the client key share is transmitted to a **Trusted Execution Environment (TEE)** hosted in an AWS Nitro Enclave. This ensures:

1. **Encrypted memory**: All data processed in the enclave is encrypted and inaccessible to anyone, including Portal employees.
2. **Verified execution**: Users can cryptographically verify that their request was handled in a secure enclave using signed measurements.

**Example**

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

await portal.initialize(
  apiKey: 'CLIENT_API_KEY_OR_CLIENT_SESSION_TOKEN',
  featureFlags: PortalFeatureFlags(
    useEnclaveMpcApi: true,
  ),
);
```

***

### `usePresignatures`

* **Type:** `bool?`
* **Default:** `null` (disabled)
* **Description:** Enables the automatic use of presignatures to improve signing latency for EVM transactions.

**How it works**

When `usePresignatures` is enabled, the SDK automatically generates and uses presignatures in the background. This reduces the time required for transactions to be signed, as the SDK pre-computes part of the MPC signing flow. Users do not need to take any additional actions — the SDK handles presignature generation and consumption automatically.

<Note>
  Presignatures currently only support the `SECP256K1` curve (EVM, Bitcoin). ED25519 (Solana) signing is unaffected by this flag — support is coming soon.
</Note>

**Example**

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

await portal.initialize(
  apiKey: 'CLIENT_API_KEY_OR_CLIENT_SESSION_TOKEN',
  featureFlags: PortalFeatureFlags(
    usePresignatures: true,
  ),
);
```

***

## Important notes

* All feature flags are **set at initialization time** and cannot be changed at runtime.
* Each flag is optional (`bool?`) — you only need to set the flags you want to enable.
* Flags not specified will use their default behavior (disabled).
