The Base-Solana bridge is currently in testnet only (Base Sepolia ↔ Solana Devnet). The code is a work in progress and has not been audited. Do not use in production!
- Transfer tokens between Base and Solana
- Send arbitrary cross-chain messages
- Deploy wrapped tokens on either chain
How it works
On Base
The Base bridge contract locks or burns your tokens and emits a message. Validators collect these messages into Merkle trees and post roots to Solana every ~15 minutes. You then prove your message exists in the tree to complete the transfer on Solana. Key Smart contracts:- Bridge Contract: Handles outgoing transfers
- CrossChainERC20: Mintable/burnable tokens for cross-chain transfers
- BridgeValidator: Validates messages with oracle signatures
- Twin Contract: Your personal smart contract on Base for executing calls from Solana
What is the Twin Contract?
The Twin Contract is a smart contract that acts as your execution context on Base.
It represents the
msg.sender
on Base when you send an arbitrary contract call from Solana.On Solana
The Solana bridge program locks or burns your tokens and emits events. Validators relay these messages to Base where they’re executed through your personal Twin contract - a smart contract that acts as your execution context on Base. Key Programs:- Bridge Program: Handles outgoing transfers
- Base Relayer Program: Coordinates message relay
Base Bridge - Official Repositoryhttps://github.com/base/bridge
Bridging Flows
Solana to Base
Automatic relay system for seamless transfers
Base to Solana
Manual proof-based transfers with full control
Full Stack Example
Complete application with frontend integration
Solana to Base
Flow: Lock SOL → Auto-Relay → Mint wSOL on Base The Solana to Base flow in this example uses automatic relay for seamless transfers. Your SOL is locked in a Solana vault, and the relayer automatically executes the message on Base to mint wrapped SOL.Solana to Base Examplehttps://github.com/basebase-bridge-examples/tree/main/solToBaseWithAutoRelay
solToBaseWithAutoRelay/index.ts
Wrap Custom SPL Tokens
The example above shows how to bridge native SOL to Base. To bridge custom SPL tokens, you need to create wrapped ERC20 representations on Base using the CrossChainERC20Factory.Token Wrapping Examplehttps://github.com/basebase-bridge-examples/tree/main/wrapSolTokenOnBase
wrapSolTokenOnBase/index.ts
Base to Solana
Flow: Burn wSOL → Wait 15min → Generate Proof → Execute on Solana The Base to Solana flow requires manual proof generation. You burn wrapped SOL on Base, wait for finalization (~15 minutes), then generate a cryptographic proof to execute on Solana and receive native SOL.Base to Solana Examplehttps://github.com/basebase-bridge-examples/tree/main/bridgeSolFromBaseToSolana
bridgeSolFromBaseToSolana/index.ts
Utilities
The repository includes utilities for converting between Solana and Base address formats, getting your Solana CLI keypair for signing transactions, and building and sending Solana transactions.Base Bridge Examples - Utilitieshttps://github.com/basebase-bridge-examples/tree/main/bridgeSolFromBaseToSolana/utils
Address Conversion
Convert Solana pubkey to bytes32 for Base contracts:example.ts
Keypair Management
Get your Solana CLI keypair for signing transactions:example.ts
Transaction Building
Build and send Solana transactions:example.ts
Sol2Base: Full Stack Example
Sol2Base - Full Stack Bridge Apphttps://github.com/base/sol2base
Bridge Service Implementation
The core bridge service handles SOL transfers with automatic relay and address resolution:src/lib/bridge.ts
Address Resolution Service
Supports ENS names and Basenames for user-friendly addressing:src/lib/addressResolver.ts
React Bridge Interface
Complete UI component with wallet integration and form validation:src/components/BridgeInterface.tsx
Bridge Form with Address Resolution
Smart form component with ENS/Basename support and validation:src/components/BridgeForm.tsx
Setup and Development
Terminal
Get your Coinbase Developer Platform (CDP) API credentials from the the portal.The example above uses the Coinbase Developer Platform faucet for SOL.
To get access to the faucet API, you can follow the instructions here.
Contract Addresses
Base Sepolia
Solana Devnet
Troubleshooting
Transaction failed on Base
Transaction failed on Base
- Ensure sufficient ETH for gas fees
- For ERC20 tokens, approve the bridge contract first using
approve()
- Verify token addresses are correct and match the expected format
- Check that your private key is correctly set in the
.env
file
Message not appearing on Solana
Message not appearing on Solana
- Wait at least 15 minutes for message relay
- Check that your Base transaction was successful and included a
MessageRegistered
event - Verify you’re using the correct network (testnet/devnet)
- Ensure the Solana bridge has processed the Base block number
Proof verification failed
Proof verification failed
- Ensure you’re using the latest Base block number from the Solana bridge
- Verify the message hash matches the original transaction
- Check that the proof was generated at the correct block height
- Make sure all account addresses are correctly derived
Auto-relay not working
Auto-relay not working
- Verify you have sufficient SOL to pay for relay fees
- Check that the Base Relayer program is properly configured
- Ensure the outgoing message was created successfully
- Monitor both Solana and Base explorers for transaction status
Security
Important Security Notes:
- Bridge is in active development and unaudited
- Only use testnet funds (Solana devnet SOL and Base Sepolia ETH)
- Validate all addresses before bridging
- Monitor transactions on both chains
- Keep your private keys secure and never share them