> For the complete documentation index, see [llms.txt](https://docs.surgecardano.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.surgecardano.com/getting-started/connecting-your-wallet.md).

# Connecting your wallet

You sign in to Surge by signing a short message with your Cardano browser wallet. There is no email, password or seed phrase involved, and the message you sign cannot move funds.

### Connect your wallet

1. Open Surge and click **Connect wallet**. A dialog lists the wallets installed in your browser (see [Supported wallets](/getting-started/supported-wallets.md)).
2. Choose a wallet. The extension asks you to allow Surge to connect. Approve it.
3. Surge requires your wallet to use the **Cardano mainnet**. Switch your wallet to mainnet if the connection stops.
4. Surge requests a one-time login message from its server. The message starts with `surge.finance login |` and contains your wallet address, the network, a timestamp and a random nonce. Surge shows the message and refuses anything else. This prevents a transaction being disguised as a login request.
5. Click **Sign**. Your wallet extension prompts you to sign the message (a "data signature", not a transaction). Approve it.
6. Surge verifies the signature and starts your session.

The login stepper shows four steps: nonce, sign, login, and complete. It identifies the failed step if something goes wrong.

### Your session

* A session lasts as long as you keep using the app; the access token is refreshed automatically in the background (it expires after 15 minutes if not refreshed, and Surge refreshes it around the 10-minute mark and on every return to the tab).
* If refresh fails because the session was revoked or expired, Surge shows "Session expired", disconnects the wallet and returns you to login.
* Surge supports Cardano mainnet only. If your wallet changes network, Surge disconnects immediately.

### Reconnecting

When you return to Surge, it reconnects to the last wallet silently. If the extension is slow to load, Surge retries three times at one-second intervals before giving up and showing the connect button.

### Log out

Use the wallet menu in the header. "Log out" ends this session; the login page also offers "log out and use a different wallet". Logging out does not delete your strategy wallets or their keys from this browser. See [Wallets in Surge](/core-concepts/wallets-in-surge.md).

### Login errors

| Message                   | Cause                                                                                  | Fix                                                            |
| ------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| Nonce expired / not found | You took too long between requesting the message and signing it, or signed a stale one | Surge automatically requests a fresh message; sign again       |
| Invalid signature         | The wallet signed with a different address than the one that requested the nonce       | Make sure the wallet's active account is the one you connected |
| Too many requests         | Login is limited to 5 attempts per minute per IP address                               | Wait a minute                                                  |
| Network mismatch          | Wallet is not using Cardano mainnet                                                    | Switch the wallet to Cardano mainnet                           |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.surgecardano.com/getting-started/connecting-your-wallet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
