What is WalletConnect?
WalletConnect is an open-source protocol that enables secure communication between decentralized applications (dApps) and cryptocurrency wallets.
Wallet Connects allows users to easily and securely connect their cryptocurrency mobile or desktop wallets to decentralized applications without sharing private keys or installing browser extensions.
WalletConnect v2 operates through a decentralized relay network, ensuring better security, reliability, and multi-chain compatibility for signing and interaction with Web3 applications.
Purpose of WalletConnect
The main purpose of WalletConnect is to simplify and secure the connection between dApps and cryptocurrency wallets. Specifically, it allows:
- Logging in to dApps using a crypto wallet.
- Signing transactions without having to share a private key.
- Interacting with decentralized services (DeFi, NFT marketplace, DAO, etc.).
- Connecting to multiple blockchains.
What does WalletConnect simplify?
- Eliminates the need to install plugins: Works on all devices without the need for Metamask or any other extension.
- Enables easy connection: Just scan a QR code or click on a link.
- Ensures interoperability: Works with various blockchain wallets (MetaMask, Trust Wallet, Rainbow, etc.).
- Eliminates security risks: The user does not need to enter the private key into the website.
How does WalletConnect ensure security?
- Encrypted communication - all communication between the dApp and the wallet is end-to-end encrypted.
- Transactions are signed locally - the dApp never sees the user's private key.
- Disconnect at any time - the connection can be canceled at any time, preventing unwanted interactions.
WalletConnect Features
WalletConnect uses decentralized relay servers to transmit encrypted messages between a decentralized application (dApp) and a wallet. Communication is done using Waku (Libp2p-based) and asymmetric encryption (AES-256-GCM).
- Decentralized Relay Network: Uses a distributed Waku-based relay system for enhanced security and scalability.
- Multi-Blockchain Support (Namespaces): dApps can now request access to multiple blockchains (Ethereum, Polygon, Solana, Polkadot, etc.) in a single connection.
- Improved Session Management: Pairing and session topics have been enhanced for more reliable connectivity.
- Enhanced Encryption: End-to-end encryption with AES-256-GCM ensures secure communication.
- Secure Transaction Signing: The private key remains inside the wallet – only signed transactions are sent to dApps.
- Flexible Session Disconnection: Users can disconnect with a specified reason, improving UX.
How does WalletConnect v2 work?
-
🔗 Connection Initialization
When a user wants to connect their wallet to a dApp, the following process occurs:
-
Session Creation
- The dApp requests a connection and generates a **pairing topic**.
- A QR code is created containing a **WalletConnect URI**, embedding the session key and supported blockchains.
- The user scans the QR code with their wallet or clicks a deep link.
→ The wallet establishes a WebSocket connection with the decentralized relay network.
-
-
🔒 Encrypted Communication via Decentralized Relayers
Unlike v1, WalletConnect v2 uses a **distributed relay network (Waku)** for message exchange:
- Messages between dApp and wallet are **end-to-end encrypted** (AES-256-GCM).
- Each session has **multiple topics**: Pairing topic (connection setup) and Session topic (ongoing communication).
- Relay servers operate on a **publish-subscribe (pub/sub) model**.
-
📝 Transaction Signing & Address Verification
Once connected, the dApp can:
- Request transaction approvals.
- Verify ownership of an address by asking the user to sign a message.
Transaction Flow:
- The dApp sends a request using
eth_sendTransaction
orpersonal_sign
. - The wallet receives the request and displays it to the user.
- The user signs the message using their private key (which never leaves the wallet).
- The wallet returns a signed response (
rawTransaction
). - The dApp submits the transaction to the blockchain.
-
❌ Disconnecting the Session
When the user decides to disconnect:
- The wallet sends a
disconnectSession()
message instead ofwc_sessionDelete
. - The relay network removes the session topics, terminating the connection.
- The dApp receives a notification and informs the user.
If the user reconnects the same wallet, they must go through a new session initialization.
- The wallet sends a
Integrating WalletConnect v2 - Demo
Just run following code and select your Wallet Connect configuration preference. The code will build a demo application for you.
npx @reown/appkit-cli
More integration guides at https://docs.reown.com/appkit/next/core/installation