Skip to main content
This guide walks you through deploying a tokenized RWA on Stellar Testnet using Soroban smart contracts and the Ankara Chain SDK. The Stellar path uses the same TokenFactory API as the EVM quickstart — only the config changes. By the end you will have a deployed Soroban token contract, minted fractional shares to a testnet account, and a working milestone escrow deal demonstrating Stellar’s on-chain payment primitive.

Prerequisites

  • Node.js 18+ installed locally
  • A Stellar testnet account with a secret key starting with S...
  • Testnet XLM to pay Soroban transaction fees — get free XLM from the Stellar Friendbot
Never commit your Stellar secret key to version control. Keep STELLAR_SECRET_KEY in .env only. In browser-based applications, use a Freighter wallet integration via stellarSigner instead of passing the raw secret key through your application code.

1

Install the SDK

Install the Ankara Chain TypeScript SDK:
You can also run CLI commands without a global install using npx:
The Stellar adapter bundles @stellar/stellar-sdk as a dependency. You do not need to install it separately — the SDK manages the Soroban RPC client and contract bindings internally.
2

Initialize your project

Run the ankara init wizard and select Stellar Testnet (Soroban) when prompted for a network:
After the wizard completes, your project directory contains:
Your .env file will include:
Replace your_stellar_secret_seed_here with your actual Stellar testnet secret key (the one starting with S). The config file starts with just the network set:
3

Set the Token Factory address

Unlike the EVM flow, you do not need to deploy your own factory contract for testnet — a shared factory is already deployed on Stellar Testnet. Set the factory address in ankara.config.json to use it immediately.Update your config to match the live testnet deployments:
The full set of live Stellar Testnet contract addresses is:
If you need isolated factory contracts under your own deployer key — for example, to run a whitelisted identity verifier that only your app controls — you can deploy your own Soroban factories from the open-source contracts. See Stellar Contracts for instructions.
4

Deploy a token

Deploy a token using the same ankara deploy flow as EVM networks:
The interactive wizard prompts for asset metadata:
The deployed contract ID (a Soroban C... address) is saved to ankara.config.json alongside your factory address. All six asset templates — Farmland, Commodity, Real Estate, Invoice, Carbon Credit, and Mining Rights — are available on Stellar with full feature parity with EVM.
5

Mint tokens

Mint fractional token shares to a Stellar testnet account:
The CLI reads your deployed token from ankara.config.json, prompts for a recipient Stellar address (a G... public key), and the amount to mint. The Soroban token contract conforms to the SEP-41 fungible token interface, so any Stellar wallet or exchange that supports SEP-41 can hold and transfer the issued shares.
6

Create a Milestone Escrow deal

The Ankara Chain MilestoneEscrow contract lets you structure payment deals tied to on-chain delivery confirmations — useful for tranche-based land purchase agreements, invoice financing draws, or commodity release schedules.Deploy an escrow contract using the CLI:
The wizard prompts for payer, payee, token, and milestone amounts. For testnet demos, you can use the native XLM Stellar Asset Contract as the escrow token:
XLM is a volatile native asset, not a stablecoin. Use it only for testnet demos. For production escrow flows, use a stablecoin like USDC that is whitelisted on your EscrowFactory.
The deployed escrow contract ID is saved to ankara.config.json under deployments. The payer can then fund individual milestones, the payee marks them as delivered, and the arbiter (if set) resolves disputes — all on-chain via Soroban invocations.

Using the SDK Directly

For programmatic use in your application — server-side scripts, backend APIs, or build pipelines — pass your Stellar secret key directly to TokenFactory. The adapter handles the Soroban RPC client, transaction signing, and result normalization:
The returned DeployResult has the same shape as on EVM chains:

Browser / Freighter integration

In browser-based applications, you should never expose the Stellar secret key. Instead, pass a stellarSigner — an object matching the Freighter wallet API shape — to avoid the raw seed ever touching application code:
stellarSigner and stellarSecretKey are mutually exclusive. If both are set, stellarSecretKey takes precedence — so never set both in the same config object.

Deploying a Milestone Escrow programmatically


Next Steps

Stellar Contracts

How Soroban contracts map to the same SDK API as EVM networks, and what Stellar-specific features are available.

EVM Quickstart

Deploy the same token on Polygon Amoy if you want to compare the EVM and Stellar flows side by side.

CLI Commands

Full reference for every ankara command and flag, including Stellar-specific options.

Escrow Contracts

Milestone-based escrow architecture, dispute resolution, and arbiter roles.