> 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/web3-integration.md).

# Web3 integration

Web3 mode connects Cifer authorization to a blockchain address. It works with any signer that satisfies the SDK adapter interface, including EIP-1193 wallets, WalletConnect-based stacks, embedded wallets, and private-key signers.

## Integration flow

```mermaid
sequenceDiagram
    participant User
    participant App
    participant Wallet
    participant Controller as SecretsController
    participant Blackbox

    User->>App: Connect wallet
    App->>Wallet: Request address and signature
    App->>Controller: Submit transaction intent
    Controller-->>App: Secret ownership and state
    App->>Blackbox: Signed encrypt/decrypt request
    Blackbox-->>App: Cifer envelope or plaintext
```

## Authorization

Encryption is public: any valid signer may encrypt for a secret. Decryption is restricted to the secret owner or an authorized delegate. Only the owner can transfer the secret or change its delegate.

## Transaction intents

The SDK builds transaction descriptions rather than sending transactions itself. Your wallet stack remains responsible for gas, nonce selection, simulation, user confirmation, and submission.

```typescript
const txIntent = keyManagement.buildSetDelegateTx({
  chainId,
  controllerAddress,
  secretId,
  newDelegate,
});

await wallet.sendTransaction(txIntent);
```

This design avoids wallet lock-in and keeps transaction control in the application.


---

# 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/web3-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.
