> For the complete documentation index, see [llms.txt](https://cifer.gitbook.io/cifer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cifer.gitbook.io/cifer-docs/documentation/cifer-sdk/web2-integration.md).

# Web2 integration

Web2 mode makes Cifer available without requiring a blockchain wallet. Users authenticate with email and password, register an Ed25519 identity key, and create an ephemeral managed session for SDK operations.

## Identity and session model

```mermaid
sequenceDiagram
    participant User
    participant App
    participant Auth as Cifer Auth
    participant Session
    participant Blackbox

    User->>App: Email and password
    App->>Auth: Register account
    Auth-->>User: Verification code
    App->>Auth: Verify email and register Ed25519 key
    App->>Session: Create managed session
    Session->>Blackbox: Sign Cifer requests
    Blackbox-->>App: Encrypted result
```

The Ed25519 key proves control of the account when creating sessions. The managed session uses an ephemeral secp256k1 signer that is compatible with Blackbox request authentication.

## Recommended client

Use `web2.createClient()` for new integrations. It stores the Blackbox URL, read client, defaults, and active session so they do not need to be repeated for every call.

Web2 uses `WEB2_CHAIN_ID = -1`. Instead of an RPC block number, request freshness is based on `Date.now()`, allowing Web2 operation without a user-facing blockchain connection.

{% hint style="warning" %}
The application is responsible for secure Ed25519 private-key storage. Do not persist identity keys in logs, analytics, source control, or unprotected browser storage.
{% 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 dynamically by asking a question.

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

```
GET https://cifer.gitbook.io/cifer-docs/documentation/cifer-sdk/web2-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
