An open-source infrastructure for bridging USDC between Base (Ethereum L2) and Stacks (Bitcoin L2). 80% cheaper than bridging via Ethereum L1.
Bridging assets to Stacks currently requires going through Ethereum L1, which is expensive. Users pay high gas fees just to move USDC into the Stacks DeFi ecosystem.
Use Base L2 as the source chain instead of Ethereum L1. Base offers:
- 80% lower gas fees than Ethereum mainnet
- Fast finality (~2 seconds)
- Strong security inherited from Ethereum
+---------------+ +---------------+
| Base | <-- Bidirectional -> | Stacks |
| (ETH L2) | Bridge | (BTC L2) |
+---------------+ +---------------+
USDC Relayer xUSDC
Deposit: Lock USDC on Base -> Mint xUSDC on Stacks
Withdraw: Burn xUSDC on Stacks -> Release USDC on Base
| Phase | Status | Description |
|---|---|---|
| Core Infrastructure | ✅ Completed | Smart contracts, relayer, frontend |
| Security Hardening | ✅ Completed | Multi-sig, timelocks, rate limiting |
| Clarity 4 Upgrade | ✅ Completed | Latest Stacks features |
| USDCx DEX Integration | ✅ Completed | Velar + Alex + xReserve adapters |
| Testnet Deployment | ✅ Completed | Base Sepolia + Stacks Testnet live |
| E2E Testing | ✅ Verified | Deposit + Withdraw flows tested |
| Mainnet Launch | ✅ LIVE | Base + Stacks Mainnet deployed |
See ROADMAP.md for full details.
| Network | Contract | Address | Verified |
|---|---|---|---|
| Base Mainnet | BridgeBase | 0x0EdF28403D027Be0917625C751c78236407dD4E0 |
✅ |
| Base Mainnet | USDC (Circle) | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
- |
| Stacks Mainnet | wrapped-usdc-v5 | SP1MTYHV6K2FNH3QNF4P5QXS9VJ3XZ0GBB5T1SJPK.wrapped-usdc-v5 |
✅ |
- Multi-Sig: 2-of-3 required for all releases/mints
- Rate Limits: 10K USDC/tx, 50K/hour, 200K/day
- Timelock: 10min for medium, 1hr for large transactions
| Network | Contract | Address |
|---|---|---|
| Base Sepolia | BridgeBase | 0xFCDF3e427e4a4CF3E573762693B9a1bBb35C504B |
| Base Sepolia | USDC (Circle) | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
| Stacks Testnet | wrapped-usdc-v5 | ST1ZGGS886YCZHMFXJR1EK61ZP34FNWNSX28M1PMM.wrapped-usdc-v5 |
✅ Base Mainnet Deployed
- Contract:
0x0EdF28403D027Be0917625C751c78236407dD4E0 - 2-of-3 multi-sig security
- Verified on BaseScan
✅ Stacks Mainnet Deployed
- Contract:
SP1MTYHV6K2FNH3QNF4P5QXS9VJ3XZ0GBB5T1SJPK.wrapped-usdc-v5 - Signers Initialized: TX 0x82f87b95...
- Block Height: 6202949
✅ Real-Time L1 Gas Comparison (NEW)
- L1 gas price from Etherscan Gas Oracle v2 API (1-min refresh)
- Dynamic fee comparison: Base L2 vs ETH L1
- Visual comparison bars (green L2 / red L1)
- Shows actual L1 bridge cost (~$0.24 at 0.5 Gwei)
✅ Dynamic Footer Stats
- Real-time average fee calculation
- Live data from
usePriceshook - Shows "<$0.01" for very low fees
✅ Real-Time Price Feeds
- ETH/USD: Chainlink price feed on Base mainnet (updates every block)
- STX/USD: Coinbase API with 5-minute cache
- Dynamic fee breakdown with live gas prices
✅ SSR-Safe Wallet Connection
- Reusable
ConnectButtoncomponent with proper hydration handling useSyncExternalStorefor React 18 compatibility- Lazy AppKit initialization via
openAppKitModal()function
✅ Network-Aware Components
BridgeStats: Auto-switches Blockscout API (mainnet/testnet)TransactionHistory: Dynamic API based onNEXT_PUBLIC_NETWORKFeeEstimator: Live price badges showing data sources
✅ E2E Testing Verified
- Full deposit/withdraw flows tested on testnet
- Transaction Evidence: See testnet transactions
End-to-End Testnet Verification Complete
- Full deposit → queue-mint → execute-mint flow tested and working!
- Base Sepolia: 10 USDC deposited and locked
- Stacks Testnet: 10 xUSDC minted successfully on
wrapped-usdc-v5
Phase 4: USDCx Integration Complete
- Velar DEX adapter (
velar-adapter.clar) with mainnet router integration - Circle xReserve alternative (
xreserve-adapter.clar) for 1:1 attestation swaps - Dual execution paths:
execute-mint-and-swap(DEX) orexecute-mint-via-xreserve - Full documentation: docs/usdcx-workflow.md
OnchainKit and Base Account Integration
- Downgraded React to 18.2 and wagmi to v2 for stability
- Pinned viem to 2.17.3 for wagmi v2 compatibility
- Added Turbopack config and root
package.jsonscripts for frontend workflows
- Node.js 18+
- Clarinet 3.11+ (contracts use Clarity 4, Epoch 3.3)
- WalletConnect Project ID (free)
- Stacks wallet (Leather or Xverse)
- MetaMask (for Base)
git clone https://github.com/unclekaldoteth/stacks-bridge.git
cd stacks-bridgecd stacks
clarinet check # Verify contracts compile
npm install # Install test dependencies
npm test # Run Vitest tests (22 tests)
clarinet devnet start # Start local devnetcd relayer
npm install
cp .env.example .env # Configure your keys
npm startcd frontend
npm install
npm run dev # Opens at http://localhost:3000Tip: from the repo root, npm run dev delegates to frontend after installing dependencies there.
| Component | Technology | Description |
|---|---|---|
| EVM Contracts | Solidity, Hardhat | Lock/release USDC on Base |
| Stacks Contracts | Clarity 4 | Mint/burn xUSDC on Stacks |
| Relayer | Node.js | Watch events, execute cross-chain txs |
| Frontend | Next.js, WalletConnect | User interface |
stacks/contracts/
├── wrapped-usdc-v5.clar # Current xUSDC token (Clarity 4) - Testnet
├── wrapped-usdc-v4.clar # xUSDC token (Clarity 4)
├── wrapped-usdc-v3.clar # xUSDC token (SIP-010)
├── wrapped-usdc-v2.clar # Legacy version
├── wrapped-usdc.clar # Original version
├── dex-adapter-trait.clar # DEX integration interface
├── velar-adapter.clar # Velar DEX adapter
├── xreserve-adapter.clar # Circle xReserve adapter
└── sip-010-trait-ft-standard.clar
evm/contracts/
└── BridgeBase.sol # USDC lock/release on Base
- Multi-Signature: 2-of-3 signers required for minting
- Timelocks: Large transactions have enforced delays
- Rate Limiting: Hourly (50K) and daily (200K) caps
- Emergency Pause: Any signer can pause, owner unpause
| Network | Contract | Address |
|---|---|---|
| Base Sepolia | BridgeBase (v2) | 0xFCDF3e427e4a4CF3E573762693B9a1bBb35C504B |
| Stacks Testnet | wrapped-usdc-v5 | ST1ZGGS886YCZHMFXJR1EK61ZP34FNWNSX28M1PMM.wrapped-usdc-v5 |
| Network | Contract | Address |
|---|---|---|
| Stacks Mainnet | USDCx (Circle) | SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx |
Note: USDCx is Circle's official USDC-backed stablecoin on Stacks, deployed via xReserve. It is only available on mainnet.
We need community help! This project is open source and welcomes contributions.
| Area | Description | Difficulty |
|---|---|---|
| USDCx Integration | Swap xUSDC to official Stacks USDCx | Hard |
| Testing | Unit tests for Clarity & Solidity | Medium |
| Documentation | API docs, deployment guides | Easy |
| Security Review | Code audit, vulnerability assessment | Medium |
- Add unit tests for Clarity contracts
- Improve error handling in relayer
- Add transaction history UI component
- Document API endpoints
- CONTRIBUTING.md - How to contribute
- docs/developer-api.md - Contract APIs + relayer flow
- docs/developer-guides.md - Setup, runbook, troubleshooting, deployment
- ROADMAP.md - Project phases and priorities
- CODE_OF_CONDUCT.md - Community standards
| Layer | Technologies |
|---|---|
| Stacks | Clarity 4, Epoch 3.3, Clarinet 3.11 |
| EVM | Solidity, Hardhat, OpenZeppelin |
| Relayer | Node.js, Viem, @stacks/transactions |
| Frontend | Next.js (React 18), TypeScript, WalletConnect, Wagmi v2, OnchainKit, Base Account SDK |
# Base (EVM)
BASE_RPC_URL=https://sepolia.base.org
SIGNER_PRIVATE_KEY=your_evm_private_key
BRIDGE_BASE_ADDRESS=0xFCDF3e427e4a4CF3E573762693B9a1bBb35C504B
# Stacks
STACKS_API_URL=https://api.testnet.hiro.so
# Optional: separate Stacks core node endpoint (falls back to STACKS_API_URL)
STACKS_CORE_API_URL=https://stacks-node-api.testnet.stacks.co
STACKS_PRIVATE_KEY=your_stacks_mnemonic_or_key
STACKS_CONTRACT_ADDRESS=ST1ZGGS886YCZHMFXJR1EK61ZP34FNWNSX28M1PMM
STACKS_CONTRACT_NAME=wrapped-usdc-v5NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_id
# Optional: OnchainKit API key (omit to use an RPC URL)
NEXT_PUBLIC_ONCHAINKIT_API_KEY=your_onchainkit_api_key
# Optional: RPC URL for OnchainKit (falls back to NEXT_PUBLIC_BASE_RPC_URL)
NEXT_PUBLIC_ONCHAINKIT_RPC_URL=https://sepolia.base.org
# Optional: EAS schema ID for OnchainKit attestation badges
NEXT_PUBLIC_ONCHAINKIT_SCHEMA_ID=0x...
NEXT_PUBLIC_BASE_ACCOUNT_APP_NAME=Stacks Bridge
NEXT_PUBLIC_BASE_RPC_URL=https://sepolia.base.org
NEXT_PUBLIC_NETWORK=testnetMIT License - see LICENSE for details.
- Hiro Systems - Stacks development tools
- Base - Scalable L2
- OpenZeppelin - Secure Solidity libraries
- Stacks Community - Feedback and support
Built for the Stacks ecosystem. Contribute and help us make cross-chain bridging accessible to everyone.