The Base-Solana bridge is currently in testnet only (Base Sepolia ↔ Solana Devnet).
- Transfer tokens between Base and Solana
- Send arbitrary cross-chain messages
- Combine both flows (transfer with arbitrary calls)
- Deploy wrapped tokens on either chain
How it works
On Base
The Base bridge contract locks or burns tokens when sending messages to Solana, and mints or unlocks tokens when receiving messages from Solana. The Bridge contract itself builds Merkle trees from outgoing messages. Validators verify the Merkle root every 300 finalized blocks and relay it to Solana. You then prove your message exists in the tree to complete the transfer on Solana.Tokens that are native to Base are locked and tokens that are native to Solana are burned when bridging to Solana.
Tokens that are native to Solana are minted and tokens that are native to Base are unlocked when bridging to Base.
- 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 handles token transfers by locking or burning tokens and emitting events. For messaging, 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 (not part of the core bridge)
Base Bridge - Official Repositoryhttps://github.com/base/bridge
The relayer program is not part of the core bridge.
This is a convenience feature built on top of the bridge to reduce friction in the Solana -> Base direction.
Bridging Flows
Solana to Base
Automatic relay system for seamless transfers
Base to Solana
Manual proof-based transfers with full control
Builder Codes
Attribute traffic and earn rewards for your bridge integrations
Full Stack Example
Complete application with frontend integration
Solana to Base
Flow: Lock SOL → Wait for Validator Pre-approval → Execute on Base The Solana to Base bridge uses a pull-based model that requires 3 steps:- Initiate the bridge on Solana - Lock your SOL or native SPL token in a Solana vault
- Wait for validators to pre-approve the message - Validators verify and approve your bridge message
- Execute the message on Base - The approved message is executed on Base to mint SOL and execute any additional arbitrary calls
Tokens that are native to Solana are locked and tokens that are native to Base are burned when bridging to Solana.
Tokens that are native to Base are minted and tokens that are native to Solana are unlocked when bridging to Base.
Solana to Base Relay Scripthttps://github.com/base/bridge/blob/main/scripts/src/commands/sol/onchain/bridge/solana-to-base/bridge-sol.handler.ts
Auto-Relay Example
This is a sample script that shows how to bridge SOL with auto-relaysolToBaseWithAutoRelay/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/base/bridge/blob/main/scripts/src/commands/sol/onchain/bridge/solana-to-base/wrap-token.handler.ts
wrapSolTokenOnBase/index.ts
Base to Solana
Flow: Burn SOL (on Base) → 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, then generate a cryptographic proof to execute on Solana and receive native SOL.Base to Solana Examplehttps://github.com/base/bridge/blob/main/scripts/src/internal/sol/base.ts
bridgeSolFromBaseToSolana/index.ts
Builder Codes
Builder codes allow developers to attribute bridge traffic and receive rewards when users bridge through their applications. This feature works with the Solana to Base bridge flow, enabling you to:- Earn rewards for driving bridge traffic
- Track attribution for your application’s bridge volume
- Chain additional calls on Base while maintaining attribution
Builder codes are currently available for Solana → Base bridge flows only.
Step 0: Register Your Builder Code
For now, Builder Codes are manually assigned by the Base team. Once issued, you’ll receive abytes32 code to use in your bridge operations.
Hook Data Schema
hookData must be exactly the ABI encoding of:
user→ The (user) destination address on Base (NOT the Twin contract address)code→ Your builder code (as bytes32)feeBps→ Fee in basis points (e.g., 100 for 1%)
Simple Bridge (No Extra Call)
Original (no attribution): Bridge 100 SOL to0xabc on Base
Flywheel.send):
Why
to = BRIDGE_CAMPAIGN_ADDRESS?When using a Builder Code, the token transfer must send the tokens to BRIDGE_CAMPAIGN_ADDRESS. That contract will then forward the tokens to the intended user (recipient) on the base network.Bridge with Existing Follow-Up Call
Original (no attribution): Bridge 100 SOL to0xabc on Base, then call Counter.increment()
Multicall executed by DelegateCall from the Twin contract context.
calls is the ABI-encoded array of Call:
Execution order matters!
Flywheel.send must be first so attribution is recorded before subsequent actions and the tokens are properly redistributed to the user.TL;DR
- Register a builder code and build
hookData = abi.encode(user, code, feeBps) - Set bridge
to = <BRIDGE_CAMPAIGN_ADDRESS>andremote_token = <WRAPPED_TOKEN_ADDRESS_ON_BASE> - No extra call?
call.ty = CalltoFlywheel.send(...) - With extra calls?
call.ty = DelegateCalltoMulticall.multicall([ Flywheel.send(...), yourCall(...) ])
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/base/bridge/tree/main/scripts/src/commands
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
.envfile
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
MessageRegisteredevent - 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:
- 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