Skip to main content
Mezo Passport is a package built on top of RainbowKit that provides additional wallet connection options specifically tailored for Bitcoin wallets and Mezo. With this package, developers can integrate Bitcoin wallet support alongside Ethereum-compatible (EVM) wallets to create a more versatile connection experience for users. Passport integrates with viem and wagmi libraries for streamlined wallet management across Bitcoin and EVM ecosystems.
If you cannot use Mezo Passport for your dApp, the configuration steps in the Configure your Environment guide are sufficient for traditional EVM development.

Before You Begin

Configure Environment

Set up development with Hardhat or Foundry

RainbowKit Documentation

Learn the basics of RainbowKit

Installation

Install Mezo Passport and its peer dependencies:
Make sure to install viem version 2.x as specified. Version 3.x may have compatibility issues.

Configuration

Basic Setup

Use the getConfig method from @mezo-org/passport to configure your WagmiProvider.
index.tsx

Configuration Options

The getConfig function accepts the following options:

Using Mainnet

To use Mezo Mainnet instead of Testnet:

Multi-Network Support

Support both Testnet and Mainnet:

Connecting Wallets

To connect to wallets, use the standard Wagmi or RainbowKit components.

Using Wagmi

YourApp.tsx

Using RainbowKit

YourApp.tsx

Custom Connect Button

Create a custom styled connect button:
CustomConnectButton.tsx

Supported Wallets

Mezo Passport supports the following wallet types:

Bitcoin Wallets

  • Xverse
  • Unisat
  • Leather (formerly Hiro Wallet)
  • OKX Wallet

EVM Wallets

  • MetaMask
  • Coinbase Wallet
  • WalletConnect
  • Rainbow Wallet
  • Trust Wallet
  • And all other RainbowKit supported wallets

Using Wagmi Hooks

Mezo Passport is fully compatible with Wagmi hooks:

Advanced Configuration

Custom Chains

WalletConnect Project ID

For production applications, provide your own WalletConnect project ID:
Get your project ID from WalletConnect Cloud.

Styling

Mezo Passport uses RainbowKit’s styling system. Customize the theme:

Troubleshooting

  • Ensure you have the wallet extension installed
  • Check that you’re on the correct network (Mezo Testnet or Mainnet)
  • Clear browser cache and try again
  • Check browser console for error messages
  • Use the chain switcher to change to Mezo network
  • Ensure your RPC endpoints are configured correctly
  • Verify the chain ID matches (31611 for Testnet, 31612 for Mainnet)
  • Ensure you have sufficient BTC for gas fees
  • Check that your contract addresses are correct
  • Verify gas estimation is working properly
  • Review transaction parameters

Next Steps

NPM Package

View the Mezo Passport NPM package for additional examples

RainbowKit Docs

Learn more about RainbowKit customization options

Wagmi Documentation

Explore Wagmi hooks and utilities

Deploy Your dApp

Review requirements for Mezo Market listing