> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/rome-academy/07-open-to-solana-wallets.md).

# 7. Open your EVM app to Solana wallets

Make your contract usable from a Solana wallet with no EVM key, covering the synthetic address, ERC-20 value, the two signatures and the atomic budget.

Your contract already works with MetaMask. Now you let a Solana wallet call it with the key it already has, so the user never creates an EVM account. They call the same contract, at the same address, against the same state.

## What you'll learn

* How a Solana wallet becomes a normal `msg.sender` on Rome.
* Why this course takes value as an ERC-20 deposit, and what `msg.value` needs from a Solana user.
* What a Solana user signs for each call, and where the transaction goes.
* What fits in one Solana transaction, and what happens to a call that does not.
* Which `deps` the SDK needs and where each one comes from.

## Before you start

* Finish [6. Tokens on both sides](https://docs.rome.builders/rome-academy/06-tokens-on-both-sides.md). This lesson assumes you know what a wrapper is and why a user grants it once.
* Have `HelloRome` deployed on Hadrian from [3. Your first contract on Hadrian](https://docs.rome.builders/rome-academy/03-first-contract-on-hadrian.md).
* Install the TypeScript SDK, as in [Rome SDK](https://docs.rome.builders/products/rome-sdk.md#typescript-sdk-rome-protocol-sdk).
* Have a Solana wallet that signs Solana v1 transactions, with a little devnet SOL and devnet USDC. Faucets are listed in [Faucets](https://docs.rome.builders/resources/faucets.md). Support for v1 transactions differs between wallets, so test yours first. [Build a dual-lane app](https://docs.rome.builders/developer-guides/dual-lane-app.md) names the wallets checked so far.

## The lesson

### Step 1. Meet the synthetic address

A Solana wallet has no EVM address, so Rome derives one from its public key. The result is the wallet's synthetic address. It is the `msg.sender` your contract sees, and it carries its own nonce and storage like any other account. The same wallet always maps to the same address.

```javascript
import { syntheticAddress } from "@rome-protocol/sdk";
const from = syntheticAddress(solanaPubkey); // an ordinary 20-byte address
```

In this course's flow the synthetic holds no tokens at rest. They start in the user's Solana wallet. The fund leg moves them into the synthetic's token account before a deposit, and only then does the wrapper's `balanceOf(synthetic)` show them. The sweep leg moves them back to the wallet after a withdraw. Read the full model in [Call EVM from Solana](https://docs.rome.builders/developer-guides/call-evm-from-solana.md#synthetic-addresses).

### Step 2. Make the contract Solana-ready

Most contracts need no change. Three rules decide whether yours is one of them:

* Take value as an ERC-20. Pull with `transferFrom` after an `approve`, and return with `transfer`.
* Point at the canonical wrapper for each token. Do not deploy your own.
* Keep each Solana-lane call inside one Solana transaction.

The first rule is the one that bites. This entry point works for MetaMask users. It fails for Solana users in the fund-and-sweep model, because their synthetic holds no native balance unless you fund it with `fundSyntheticGas`:

```solidity
function deposit() external payable { balanceOf[msg.sender] += msg.value; }
```

This one works for both, because both lanes can fund a `transferFrom`:

```solidity
function deposit(uint256 amount) external {
    require(token.transferFrom(msg.sender, address(this), amount));
    balanceOf[msg.sender] += amount;
}
```

Wrapper addresses are on [Contract Addresses](https://docs.rome.builders/reference/contract-addresses.md). The checks for a Solana-ready contract are in [Open your Solidity contract to Solana users](https://docs.rome.builders/pages/QQmOT5sDIQcUnRUM4fU6#id-2.-what-makes-a-contract-solana-ready).

### Step 3. Know what the wallet signs

The SDK call is `submitRomeTxV1`. For each call, the proxy composes one Solana v1 transaction. The wallet signs twice with the same key. First it signs a readable authorization message that names the EVM transaction hash. Then it signs the transaction itself.

The app sends the signed transaction to the Solana RPC, not to the Rome proxy. The chain checks the authorization through the Ed25519 program and runs your call as the synthetic address. The user never holds an EVM key.

Before the wallet signs the transaction, the SDK checks that it carries exactly the call the user authorized. Anything else is refused. The details are in [Open your Solidity contract to Solana users](https://docs.rome.builders/pages/QQmOT5sDIQcUnRUM4fU6#id-3.-let-a-solana-wallet-call-it).

### Step 4. Wire the lane

The SDK needs five values: a proxy URL, a chain ID, the Rome program ID, a Solana RPC connection and a signer. Four describe the chain. One comes from the wallet.

```javascript
const deps = { connection, proxyUrl, chainId, programId, signer };
const res = await submitRomeTxV1(deps, { to: helloRome, data }); // helloRome: your lesson 3 contract; data: the ABI-encoded greet() call
```

For Hadrian, read the four chain values from the registry. The mapping is in the `deps` table of the guide linked in step 3, and the values are on [Hadrian](https://docs.rome.builders/networks/hadrian.md). Lesson 11 covers the same wiring for Rubicon.

Two one-time steps come before a new user's first value-moving call. Provision the synthetic with `buildCreatePdaCall`, and grant the wrapper if `isEnabled` is false. `submitRomeTxV1` does not provision for you. Lesson 9 runs both in order.

### Step 5. Stay inside one transaction

A Solana-lane call has to fit one Solana transaction: about 1.4M compute units, 64 accounts and 4 KB. Measure with `computeUnitsConsumed` from the Solana receipt, not EVM `gasUsed`. Request the transaction with `maxSupportedTransactionVersion: 1`; without it the RPC refuses the request.

When a call does not fit, the composer refuses it and the SDK hands it to the proxy to relay with the same authorization signature. The user still sees one prompt. The result carries `route: "relay"`. A relayed call spends the synthetic's native gas, so top it up first with `fundSyntheticGas`. A relayed call that reverts does not throw. Check `receipt.status`. The rules are in [Relayed calls and long calls](https://docs.rome.builders/developer-guides/call-evm-from-solana.md#relayed-calls-and-long-calls). Limits in one table: [Constraints](https://docs.rome.builders/core-concepts/constraints.md).

## Check yourself

Answer these, then open the answers.

1. Why does a `payable` deposit fail for a Solana user?
2. How many signatures does the wallet produce per call, and what does each cover?
3. Where does the signed transaction go?
4. A call needs more than one transaction. What does the user see, and who pays?

<details>

<summary>Answers</summary>

1. The user's money is an SPL token in their wallet, shown on Rome as the wrapper. The synthetic holds no native balance in the fund-and-sweep model unless you fund it, so there is no `msg.value` to send.
2. Two. The first covers a readable authorization message with the EVM transaction hash. The second covers the Solana transaction.
3. To the Solana RPC, sent by the app. The proxy composes the transaction and does not receive it, except for a relayed call.
4. One authorization prompt. The proxy relays the call and the synthetic's native gas balance pays for it.

</details>

## Next

[8. Open your Solana program to EVM users](https://docs.rome.builders/rome-academy/08-open-your-solana-program-to-evm-users.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rome.builders/rome-academy/07-open-to-solana-wallets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
