Oct 18, 2026Updated Nov 12, 2026By Cavos

How to Set Up a Stellar Wallet in Your App (2026)

How to set up a Stellar wallet in your app: @cavos/kit 0.5.2, sign in, G… before Horizon, first sponsored execute. No Freighter or seed.

An embedded wallet lives inside your application. The user signs in the way they already do. The product resolves an on-chain Stellar account they can pay, receive, and sign with, no browser extension, no seed phrase, no trip to Freighter.

This guide is how to set up a Stellar wallet and create a Stellar wallet for users inside your product: an embedded, in-app wallet for developers, including mobile. It uses @cavos/kit 0.5.2. It is the how-to companion to the Stellar embedded wallet page. The chain page is the account model. This post is the install: App ID, Google / Apple / email login, the G… address before the account exists, the first sponsored execute, balance, signMessage, and React Native notes for iOS and Android. GitHub (since 0.5.0) and Telegram are optional web-only logins; Telegram needs 0.5.2. See Sign in with Telegram (Kit 0.5.2). The provider shortlist for this chain is best embedded wallets for Stellar. The cross-chain React walkthrough is how to add an embedded wallet.

Cavos, LLC is a software and SaaS company. The wallet is the main product: a hardware-isolated, non-custodial embedded wallet. Signing keys are created and used on the user’s device. Keys never leave the device in plaintext. Cavos cannot see them, sign with them, or move funds. The Stellar adapter provisions a classic G… account, not a Soroban contract account and not a Freighter connect flow.

Pricing publishes the free 1,000 wallet creates, Essential at $59/mo, and Complete at $139/mo.

Who this is for

This guide is for app developers who need to set up a Stellar wallet inside a product. It is not a consumer Stellar Android or iOS wallet from an app store, and it is not a Freighter install walkthrough.

Use this path when:

  • Users should never install Freighter, paste a seed, or leave your UI.
  • You want a classic G… that exchanges, anchors, and Horizon already understand, not a Soroban contract account.
  • The first on-chain step should be sponsored: Gas Sponsorship in Any Token, so the user locks no XLM to start.
  • You can wrap the tree in CavosProvider on React / Next.js, or @cavos/kit/react-native on an Expo Development Build, EAS, or bare React Native (Android API 28+, iOS 16+; a work in progress). Expo Go is not supported.

Skip this path when the user already holds a Stellar address you must connect. Cavos provisions a G… from login. It does not speak Freighter or any other extension. The fork is the next section.

Embed a G account versus connect Freighter

Set up a Stellar wallet in your app can mean two different products. Pick the one that matches who creates the account.

| Decision | Embed a classic G… (this guide) | Connect Freighter | |----------|-----------------------------------|-------------------| | Who creates the account | Your app, from a login the user already has | The user, in an extension they installed | | Where they approve | Your UI | A Freighter popup you do not control | | What they install | Nothing beyond your product | Freighter (and often a seed backup) | | Address before Horizon | connect returns a G… while status is undeployed | The account already exists on-chain | | First on-chain step | Sponsored execute creates the account (0 XLM cost to the user) | You request an account that already has reserves | | Typical audience | People who should never see a wallet picker | People who already hold a Stellar wallet |

Embed when the wallet is part of sign-up. Connect Freighter when the product is a dapp among dapps and the address must be one the user already has. The two models can coexist in a product, but not in this SDK: Cavos does the embed path only. The UX comparison is embedded wallet vs browser extension. Provider rows for this chain are best embedded wallets for Stellar.

How to set up and create a Stellar wallet

This is the developer path, not a consumer Stellar Android wallet from an app store. Users never install Freighter, paste a seed, or leave your UI.

  1. Install @cavos/kit 0.5.3 (React) or @cavos/kit/react-native (iOS 16+ / Android 9+, a work in progress). Numbered section 1.
  2. Create an app in the Cavos dashboard and copy the App ID. Numbered section 2.
  3. Wrap the tree in CavosProvider with chains: ["stellar"] (native chain: "stellar" on React Native). Numbered section 3.
  4. Sign the user in with Google, Apple, or email. Connect returns a classic G… before the Horizon account exists. Numbered section 4.
  5. Read that undeployed G… (section 5), then create() creates the on-chain account (0 XLM cost to the user), and a payment follows once it holds XLM (section 6).

Follow those five steps in order. Sections 7 and 8 cover balance, signMessage, and React Native. Do not skip the App ID: on Stellar it is what activates the gasless relayer.

Cavos ships native embedded wallets for Starknet, Solana, and Stellar. It does not ship Midnight, Aleo, Cosmos, or Sui adapters. The account model, HKDF spend key, and relayer live on the Stellar embedded wallet page. What an embedded wallet is (custody, key models, how to choose an SDK) is the embedded wallet guide.

What you are installing

@cavos/kit is a Stellar wallet SDK for apps that should never show a wallet picker. Authentication selects which user this is. The kit looks up (userId, appId, chain, network) in the registry and returns that G…, or claims a new one. The first device to register wins. A signer bound to the device authorizes transactions from inside your UI.

That is the opposite of connecting Freighter. Freighter is a browser extension the user installed. You request an account that already exists. Cavos creates a Stellar wallet for users who have never used crypto: they sign in, you get an address, you send.

Custody is separate from that UX. Some embedded wallets hold a key, split one with MPC, or delegate signing to an HSM. Cavos does not. The G… is HKDF of a MasterDEK that stays on the device. Evaluate any SDK on custody before you write the first connect.

1. Install @cavos/kit

npm install @cavos/kit@^0.5.2

The React bindings live on the same package, under @cavos/kit/react. You do not install a second library. Mobile (@cavos/kit/react-native) is a work in progress, covered in the React Native section below. Expo Go is not supported. Telegram as a hosted login needs 0.5.2; see Sign in with Telegram (Kit 0.5.2). Kits 0.5.0 and 0.5.1 still work for Google, Apple, email, and GitHub against the current enclave. 0.4.x does not.

2. Create an app and copy the App ID

Create an app in the Cavos dashboard and copy its App ID. The kit reads it in the browser as NEXT_PUBLIC_CAVOS_APP_ID. On Stellar the App ID is what activates the gasless relayer: Gas Sponsorship in Any Token. The kit relayer sponsors reserves and fee-bumps so the user holds no XLM to start.

Register every callback URL for the app in Dashboard → App → Callback URLs, one per line, matched exactly: scheme, host, path, no trailing slash, and no wildcards. OAuth rejects a redirect_uri that is not registered. Add tunnel or preview domains while developing; each one is a distinct origin.

Never change appSalt after users exist. On Stellar it is the HKDF salt for the spend key, so changing it derives a different G… that will not match the registry row.

3. Wrap the tree in CavosProvider

For UI applications, use the bindings from @cavos/kit/react. Wrap the app once. Every descendant can call useCavos().

import { CavosProvider } from "@cavos/kit/react";

export function Providers({ children }) {
  return (
    <CavosProvider
      config={{
        chains: ["stellar"],
        defaultChain: "stellar",
        network: "testnet",
        appSalt: "my-app",
        appId: process.env.NEXT_PUBLIC_CAVOS_APP_ID,
        deviceApproval: "enclave",
        socialRecovery: true,
      }}
      modal={{ appName: "My App" }}
    >
      {children}
    </CavosProvider>
  );
}

network: "testnet" resolves to stellar-testnet; "mainnet" resolves to stellar-mainnet. Passing modal={{ appName: "My App" }} mounts the hosted login modal. Omit modal if you will drive auth yourself.

deviceApproval: "enclave" (with socialRecovery) is the current multi-factor path: the G… is HKDF of the MasterDEK (cavos-ed25519-stellar-v1, salted by appSalt). deviceApproval: "passkey" is one chain, fine for a Stellar-only app, not for a shared login across Starknet, Solana, and Stellar.

If you already authenticate users (Clerk, Auth0, your own session), pass a stable userId as identity. Cavos login turns off: the modal is not mounted and login() throws. Pass null while your auth is loading and once the user signs out. Use an immutable primary key, not an email that can change. If userId changes, the registry lookup is for a different user, a different wallet.

Do not pass a Starknet paymasterApiKey on a Stellar-only config. That key is for the Starknet paymaster; a paymaster key on a chain that ignores it is a config error.

See the React and authentication docs for identity, deviceApproval, and socialRecovery.

4. Sign the user in (Google, Apple, email)

Hosted login is Google, Apple, or an enclave-verified 9-character email code. Authentication exists for one reason: to produce a stable userId (plus optional email) that the registry keys on. The login never signs transactions. That is always the device key.

import { useCavos } from "@cavos/kit/react";

function Wallet() {
  const { address, isAuthenticated, walletStatus, openModal, login, logout } =
    useCavos();
  if (!isAuthenticated) {
    return (
      <>
        <button onClick={openModal}>Sign in</button>
        <button onClick={() => login("google")}>Continue with Google</button>
        <button onClick={() => login("apple")}>Continue with Apple</button>
      </>
    );
  }
  return (
    <div>
      {address} · undeployed={walletStatus.isUndeployed} ·
      ready={walletStatus.isReady}
    </div>
  );
}

openModal() opens the hosted flow. login("google") and login("apple") start OAuth. Email uses sendOtp(email) / verifyOtp(email, code):

const { sendOtp, verifyOtp } = useCavos();

await sendOtp(email);
await verifyOtp(email, code); // 9 characters, lowercase letters and digits

The Cavos recovery enclave, running in AWS Nitro, generates that code, mails it, and verifies it. A code expires after 5 minutes and allows 3 attempts. Email, Telegram, and GitHub are not available on React Native because that build cannot verify enclave attestation; use Google or Apple there.

GitHub (since 0.5.0) and Telegram are optional hosted logins on web. Telegram needs 0.5.2. Telegram on web is optional OAuth via oauth.telegram.org, not a Telegram Mini App. Email, Telegram, and GitHub are not available on React Native because that build cannot verify enclave attestation; use Google or Apple there. Default modal providers stay Google, Apple, and email. The Telegram install is Sign in with Telegram (Kit 0.5.2).

When you connect, the kit looks up the address:

(userId, appId, chain, network) → registry lookup → G…

If the registry has an entry, that address is returned. If not, this device computes a candidate G… and claims it. The registry is insert-only.

5. Read the G… before the account exists

Connect never creates the Stellar account. After login you already have a G…:

const { wallet } = useCavos();

if (wallet?.chain === "stellar") {
  console.log(wallet.address); // G… available while status is "undeployed"
  console.log(wallet.status);  // "undeployed" | "ready" | "needs-device-approval"
}

| Status | Meaning | Can execute? | |--------|---------|--------------| | undeployed | Address resolved, no on-chain account yet. | Yes: call create() first. | | ready | Account exists and this device can sign. | Yes | | needs-device-approval | This device has no key yet. Restore the MasterDEK. | No: restore with a passkey or the enclave. |

Both undeployed and ready wallets can execute and signMessage. Only needs-device-approval blocks transactions. That status means this device holds no key yet. It is not an on-chain device list. Do not create a second wallet for the same login.

Share the G… with your backend, your UI, or a counterparty while it is still undeployed. The Stellar docs call this lazy deploy: the address is real; the Horizon account is created by create().

6. Create the account, then pay

wallet.create() (@cavos/kit 0.5.3) is the on-chain create. Connect already returned a G…. Horizon does not have the account yet. You never call CreateAccount yourself.

What create() and the payment do:

  1. If status is undeployed, the kit creates the account first (sponsored, 0 XLM cost to the user). The relayer is the transaction source and fee payer. CreateAccount starts at 0 XLM plus Cavos cv: data. The relayer is not drained into the new account.
  2. Native XLM cannot ride that create: the account has to exist before it can send, and a 0-balance create holds no stroops to move. Share the G…, fund it, then call execute. An execute on an undeployed account also creates it, but its payment fails with op_underfunded until XLM arrives.
  3. After that, status is ready. Later execute calls are ordinary native XLM payments.

Narrow on wallet.chain === "stellar" so TypeScript exposes the Stellar methods. In React, call wallet.execute on the Stellar handle; the context execute is Starknet-only.

const { wallet } = useCavos();

if (wallet?.status === "needs-device-approval") {
  throw new Error("This device has no key yet. Restore the MasterDEK.");
}

if (wallet?.chain === "stellar") {
  await wallet.create();      // sponsored CreateAccount with 0 XLM; no-op once ready
  const hash = await wallet.execute(
    10_000_000n,              // 1 XLM, in stroops; the account must hold it
    "GDESTINATION...ADDRESS",
  );
}

create() creates the account (sponsored, 0 XLM cost to the user) and sends nothing; after it, status is ready. The payment then moves XLM the account holds, so fund the G… between the two calls. execute(amount, destination) moves amount stroops of native XLM out of the account.

The relayer’s create path is a 0-balance CreateAccount plus Cavos cv: data. The relayer is not drained into the new account. The user pays no reserve and no fee for that create. The payment that follows still moves stroops the account holds, which is why the chain page says share the G…, fund it, then execute.

Pass { sponsored: false } to submit directly from the account’s own XLM instead of the relayer:

await wallet.execute(10_000_000n, destination, { sponsored: false });

Without an App ID, a funded stellarSourceKeypair can fund reserves and pay fees. The App ID path is the one this tutorial uses.

Imperative connect, if you are not using the provider:

import { Cavos } from "@cavos/kit";

const session = await Cavos.connect({
  chains: ["stellar"],
  defaultChain: "stellar",
  network: "testnet",
  appSalt: "my-app",
  identity,
  appId: process.env.NEXT_PUBLIC_CAVOS_APP_ID,
});

const wallet = session.wallet("stellar");

network: "testnet" is the right default until you have sponsorship limits and callback URLs for production. See wallet actions for amounts and Stellar for the adapter.

7. Balance and signMessage

Native balance is stroops, as a bigint:

if (wallet?.chain === "stellar") {
  const stroops = await wallet.balance(); // bigint, native XLM
  const xlm = Number(stroops) / 10_000_000;
}

signMessage works on both undeployed and ready wallets: the control key exists at connect time, before Horizon has the account:

const sig = await wallet.signMessage("Hello, Cavos!");
// sig.signature: Uint8Array
// sig.publicKey: "G..." (control key's G address)
// sig.curve: "ed25519"

The message is prefixed with Cavos Signed Message:\n<len>\n before signing. Reconstruct that prefix with prefixedMessageBytes from @cavos/kit before verifying. A verifier calls Keypair.fromPublicKey(controlAddress).verify(messageBytes, signature), standard ed25519 math. Nothing is submitted; no fee is paid.

How keys, recovery, and the relayer work

The spend key is one Ed25519 key derived via HKDF from the MasterDEK (cavos-ed25519-stellar-v1, salted by appSalt). In the browser that control key is a non-extractable WebCrypto key held by the Cavos vault. React Native is a work in progress: Stellar there is not on the MasterDEK path yet. The SDK does not enforce non-extractability on Node or other server runtimes.

A new device restores the MasterDEK and derives the same key. There is no on-chain device-signer list, and there is no on-chain social recovery.

After login, call enrollPasskeyDefault(). Signing up never prompts. The passkey stores an encrypted copy of the MasterDEK; it is not 2FA. Anyone with that synced passkey can open the wallet.

Hardware-isolated recovery is opt-in per environment. When it is on, signing in again with Google, Apple, or an enclave-verified email code unwraps the same DEK. Restore paths are another signed-in device, a passkey, and that opt-in enclave. If every device and every restore factor is gone, Cavos cannot recover the wallet.

The relayer is only a fee payer and reserve sponsor, never a custodian or identity authority. Every Stellar account locks XLM reserves (a base reserve plus about 0.5 XLM per subentry). With the relayer those reserves and all fees are sponsored, so the user locks no XLM. A bad or absent relayer can cost fees; it cannot move funds or squat an address. Signing stays on the device.

See recovery and hardware-isolated recovery.

8. React Native notes

React Native is a work in progress and not production-ready. Use @cavos/kit/react-native with Expo Development Builds, EAS, or bare React Native. Expo Go is not supported: custom native modules require a development build. Minimum platforms are iOS 16 and Android 9 (API 28). Email, Telegram, and GitHub are not available on React Native because that build cannot verify enclave attestation; use Google or Apple. Telegram is web only (OAuth via oauth.telegram.org, not a Telegram Mini App).

The native provider keeps the same configuration shape, with native-only redirectUri, rpId, and minimumKeySecurity. The chain field is singular (chain, not chains):

import { CavosProvider } from "@cavos/kit/react-native";

export function Providers({ children }) {
  return (
    <CavosProvider
      config={{
        appId: process.env.EXPO_PUBLIC_CAVOS_APP_ID,
        appSalt: "my-app",
        chain: "stellar",
        network: "testnet",
        redirectUri: "myapp://auth",
        rpId: "auth.example.com",
        minimumKeySecurity: "os-protected",
      }}
    >
      {children}
    </CavosProvider>
  );
}

Register the exact redirectUri in Callback URLs. Import @cavos/kit/react-native before any chain entrypoint so the Hermes polyfills run first; a missing shim shows up as crypto.getRandomValues must be defined or a relayer rejection for invalid Stellar XDR. Full setup is in the React Native docs.

Beyond the first payment

The same G… is a real Stellar signer. After status === "ready" you can:

  • invokeContract({ contractId, method, args }): simulate, re-sign only this account’s Soroban auth entry, submit (sponsored by default).
  • addTrustline({ code, issuer }) / tokenBalance({ code, issuer }): classic assets such as USDC. A trustline adds a subentry (reserve), sponsored by default.
  • signXdr(unsignedXdr): sign an unsigned envelope without submitting it.

invokeContract and addTrustline require a deployed account. Call create() first on a new account. Paying reserves in a held token (USDC, not sponsored XLM) is a separate package, @cavos/reserve, signed with wallet.signXdr.

If you also configure Starknet on the same login, that adapter uses an audited OpenZeppelin account contract, not a Cavos-written one. Each chain still has its own address.

What to read next

Frequently asked

How do I set up a Stellar wallet in my app in 2026?

Install @cavos/kit 0.5.2, create an App ID, wrap the tree in CavosProvider with chains: ["stellar"], sign the user in, then call create() to create the account with sponsorship. Connect returns a G… before Horizon has the account. Users never install Freighter. The Stellar embedded wallet page is the account model. Pricing lists the free 1,000 wallet creates. Best embedded wallets for Stellar is the provider shortlist.

Who is this Stellar wallet setup guide for?

App developers who need to set up a Stellar wallet inside a product: React and Next.js; React Native (Expo Development Build, EAS, or bare; not Expo Go) is a work in progress. Android API 28+ and iOS 16+. It is not a consumer Stellar wallet from an app store. Users never install Freighter or paste a seed. Signing stays on the device. Keys never leave the device in plaintext.

When should I embed a Stellar G account instead of connecting Freighter?

Embed a classic G… when users should never install Freighter, paste a seed, or leave your UI: consumer apps, games, and checkout. Connect Freighter when the user already holds a Stellar address you must use. Cavos provisions a G… from login. It does not connect an existing extension. This guide is the embed path.

How do I set up a Stellar wallet as a developer?

Install @cavos/kit 0.5.2, create an App ID, wrap the tree in CavosProvider with chains: ["stellar"], and sign the user in with Google, Apple, or an enclave-verified email code. Connect returns a G… address before the account exists on-chain. create() creates the account (sponsored, 0 XLM cost to the user); a payment follows once the G… holds XLM. That is how to set up and create a Stellar wallet inside your app, not a Freighter connect flow.

How do I create a Stellar wallet for users without Freighter?

Install @cavos/kit 0.5.2, create an App ID, wrap the tree in CavosProvider with chains: ["stellar"], and sign the user in with Google, Apple, or an enclave-verified email code. Connect returns a G… address before the account exists on-chain. create() creates the account (sponsored, 0 XLM cost to the user); a payment follows once the G… holds XLM. Users do not install Freighter or paste a seed.

What does the first sponsored execute do?

Connect never creates the Horizon account. wallet.create() creates it (sponsored, 0 XLM cost to the user) as a 0-balance CreateAccount plus Cavos cv: data. Native XLM cannot ride that create, so a payment is a follow-up once the G… holds stroops. You never call CreateAccount yourself. The relayer sponsors reserves and fees (Gas Sponsorship in Any Token).

Can I create a Stellar wallet in an Android app?

Not for production yet: React Native is a work in progress, and Stellar there is not on the MasterDEK path. It runs with @cavos/kit/react-native on an Expo Development Build, EAS, or bare React Native. Minimum Android is API 28 (Android 9); iOS 16 is the iOS floor. Expo Go is not supported. Email, Telegram, and GitHub are not available on React Native because that build cannot verify enclave attestation; use Google or Apple. The native provider uses chain: "stellar" (singular). Register the exact redirectUri in Callback URLs.

Does connect create the Stellar account?

No. Connect looks up (userId, appId, chain, network) in the registry and returns a G… address, or claims a new one. It never creates the on-chain account. An undeployed wallet already has that address. create() creates the account in a sponsored transaction. After that, status is ready.

What is a sponsored Stellar account in Cavos?

When an App ID is set, the Cavos relayer is the transaction source and fee payer and sponsors the account’s XLM reserves, so the user locks no lumens to start. CreateAccount starts at 0 XLM; the relayer is not drained into the new account. Pass { sponsored: false } to have the account pay its own fee. The relayer cannot move funds or squat an address.

Is a Cavos Stellar wallet a Soroban contract account?

No. Cavos provisions a classic G… Stellar account, the same address format wallets, exchanges, and Horizon already understand. The same G… can still invoke Soroban contracts and satisfy require_auth after the account exists (status ready). invokeContract and addTrustline require that deployed account; native XLM transfers can create it on first execute.

Who can sign and move funds?

Signing is local. The G… key is one Ed25519 spend key derived via HKDF from the MasterDEK (cavos-ed25519-stellar-v1, salted by appSalt). A new device restores that MasterDEK and derives the same key. Cavos cannot see the key, cannot sign with it, and cannot move funds. Login selects which user this is; it never authorizes a spend by itself. If every device and every restore factor is gone, Cavos cannot recover the wallet.

Add a non-custodial wallet in minutes.

Free up to 1,000 wallets. Hardware-isolated, non-custodial. Keys never leave the device in plaintext.

We use anonymous analytics to understand how developers use Cavos. No personal data is collected. Privacy Policy