For the complete documentation index, see llms.txt. This page is also available as Markdown.

COTI Wallet Plugin

React library for adding COTI private token support to wagmi/RainbowKit dApps.

The COTI Wallet Plugin (@coti-io/coti-wallet-plugin) is a React library that lets dApp developers add COTI private token (pToken) support to an existing wagmi v2 + RainbowKit stack — without building a custom wallet or hand-rolling AES key management.

Important: This library is a plugin for existing dApps and wallets, not a standalone wallet application. It is designed to be injected into your existing React/wagmi stack to seamlessly enhance standard wallets with COTI network privacy capabilities.

When to use it

Use the COTI Wallet Plugin when you are building a React dApp that needs:

  • Wallet connection via MetaMask, Rabby, WalletConnect, and other EIP-1193 wallets

  • AES key onboarding and unlock for private token balances

  • Public ↔ private token bridging

  • Private encrypt/decrypt/send operations

If you are building without React or wagmi, use the lower-level TypeScript SDK, Ethers.js, or COTI MetaMask Snap integration guides instead.

What it does

Capability
How

Wallet connection

WagmiRainbowKitProvider — MetaMask, Rabby, WalletConnect, and more

AES onboarding / unlock

Built-in OnboardModal — Snap, contract onboarding, encrypted backup restore

Private balance display

Auto-decrypt on-chain ciphertext balances

Public ↔ private bridging

Native COTI bridge on COTI chains; PoD Privacy Portal on Sepolia / Avalanche Fuji

Private crypto ops

encryptPrivateValue, decryptPrivateValue, sendPrivateToken

Network enforcement

NetworkGuard for supported chains

Supported chains

Chain
Chain ID
Portal strategy

COTI Testnet

7082400

COTI native bridge

COTI Mainnet

2632500

COTI native bridge

Sepolia

11155111

PoD Privacy Portal

Avalanche Fuji

43113

PoD Privacy Portal

Unlock is wallet-based (same on every supported chain), in preferred order:

  1. MetaMask Snap (when MetaMask + Snap is available)

  2. Encrypted backup restore

  3. Contract onboarding (on COTI)

  4. Manual AES key input (if the host enables it)

See AES Key Onboarding for routes and fallbacks.

Relationship to other COTI tools

Product
Role

Key storage and Snap-backed crypto; the plugin calls it via RPC

Low-level encrypt/decrypt primitives; wrapped internally by the plugin

Contract onboarding (generateOrRecoverAes); used internally

A dApp that may consume the plugin; not required to use the library

Installation

Peer dependencies

Quickstart

See the Integration Guide for the full provider setup, unlock flow, and private action guards.

dApp API contract

dApps should not handle AES keys in the normal integration path. Use the plugin provider and hook APIs to connect wallets, onboard/unlock private balances, and execute private operations. The plugin owns AES retrieval, backup restore, Snap storage, and Snap-backed decrypt/encrypt calls internally.

For MetaMask Snap wallets, runtime private operations use Snap RPCs without extracting the AES key from Snap. For non-Snap wallets, the plugin keeps any recovered key in plugin session state only as needed.

Example app

See Example App for setup and run instructions. Source code lives in the coti-wallet-plugin GitHub repository.

Next steps

Last updated

Was this helpful?