Skip to content

Conversation

youssefea
Copy link
Contributor

What changed? Why?

Adding a guide for developers using the new Base <> Solana bridge

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Oct 2, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@cb-heimdall
Copy link
Collaborator

Review Error for kmk142789 @ 2025-10-06 14:32:37 UTC
User must have write permissions to review

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**

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

## 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.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated language

</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.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not redundant - the tip explains a bit more and gives more context

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see what you mean. I think it's ok to leave it there to make sure whoever is reading only that section has the full context.

</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.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added clarification

</Card>
</CardGroup>

## Solana to Base

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:

  1. Initiate the bridge on Solana
  2. Wait for validators to pre-approve the message
  3. 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


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" />

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


**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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to leave it there to make sure people are aware of it, but I added a callout to make sure it's visible

## How it works

### On Base
The Base bridge contract locks or burns tokens when sending messages to Solana,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We say "locks or burns" and "mints or unlocks"

Is it truly either? Or are we using these words as synonyms? If its just synonyms we should pick a single word. I think "lock" and "unlock" are the most immediately understood by the widest audience

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's either, and it depends if the token is native to base (locks) or native to solana (burns) - I'll clarify it though, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added callouts to clarify

Copy link
Collaborator

@ericbrown99 ericbrown99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A broader preference of mine would be to move the "how it works" section below the implementation sections. And then in the implementation sections, we could have an internal link to the how it works section, something like "Read here to learn more about how the solana <>Base bridge works"
This focuses the doc on implementation and our general goal of shortening time to implementation, while still ensuring that the way the bridge works is documented

@youssefea
Copy link
Contributor Author

A broader preference of mine would be to move the "how it works" section below the implementation sections. And then in the implementation sections, we could have an internal link to the how it works section, something like "Read here to learn more about how the solana <>Base bridge works" This focuses the doc on implementation and our general goal of shortening time to implementation, while still ensuring that the way the bridge works is documented

I would generally agree once we have clearer and easier paths towards integration (SDK), but I think in this case, it is unfortunately hard to start implementing without a basic understanding of how the bridge works - as it's a still a bare-bone smart contracts protocol and any developer would have to interact with the contract directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants