-
Notifications
You must be signed in to change notification settings - Fork 167
Base Solana Bridge Guide #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
🟡 Heimdall Review Status
|
Review Error for kmk142789 @ 2025-10-06 14:32:37 UTC |
The Base-Solana bridge enables bidirectional token transfers and message passing between Base and Solana networks. This bridge allows you to: | ||
|
||
* **Transfer tokens** between Base and Solana | ||
* **Send arbitrary cross-chain messages** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also mention the ability to combine transfer + calls
## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bridge contract locks or burns when sending messages from Base -> Solana. It also mints / unlocks tokens when receiving messages from Solana. Also, validators do not build merkle trees, this is done directly in the Bridge contract itself, and validators verify the merkle root every 300 finalized blocks to be relayed to Solana
</Tip> | ||
|
||
### 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a smart contract that acts as your execution context on Base.
Is this redundant after the Tip
right before it?
</Tip> | ||
|
||
### 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where they're executed through your personal Twin
This is only for messaging, but not for token transfers
|
||
## Solana to Base | ||
|
||
**Flow:** Lock SOL → Auto-Relay → Mint wSOL on Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Flow:** Lock SOL → Auto-Relay → Mint wSOL on Base | |
**Flow:** Lock SOL → Auto-Relay → Mint SOL on Base |
</Card> | ||
</CardGroup> | ||
|
||
## Solana to Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this section should probably make it clear that the bridge is a pull-based model in the Solana -> Base direction as well. Meaning a bridge flow requires 3 steps:
- Initiate the bridge on Solana
- Wait for validators to pre-approve the message
- Execute the message on Base
We will be operating a relayer service that will handle step 3 for users that only want to worry about the init tx on Solana
|
||
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. | ||
|
||
<GithubRepoCard title="Solana to Base Example" githubUrl="https://github.com/basebase-bridge-examples/tree/main/solToBaseWithAutoRelay" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought more about this and you can probably just link to https://github.com/base/bridge/blob/main/scripts/src/commands/sol/onchain/bridge/solana-to-base/bridge-sol.handler.ts which is what I based my example off of
To bridge custom SPL tokens, | ||
you need to create wrapped ERC20 representations on Base using the CrossChainERC20Factory. | ||
|
||
<GithubRepoCard title="Token Wrapping Example" githubUrl="https://github.com/basebase-bridge-examples/tree/main/wrapSolTokenOnBase" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
**Key Programs:** | ||
- [**Bridge Program**](https://github.com/base/bridge/blob/main/solana/programs/bridge): Handles outgoing transfers | ||
- [**Base Relayer Program**](https://github.com/base/bridge/blob/main/solana/programs/base_relayer): Coordinates message relay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relayer program is not part of the core bridge - this is a convenience feature we are operating on top of the bridge to reduce friction in the Solana -> Base direction
What changed? Why?
Adding a guide for developers using the new Base <> Solana bridge