Get Started

OpenZeppelin's Stellar library gives you audited Soroban building blocks: tokens, access control, smart accounts, the confidential token, governance and more. This page points you to the right starting place for what you want to build, then walks you through setting up, building and deploying your first contract.

Start Building

Find what you want to build, start from the linked docs and examples, and check the last column before you go to production.

I want to build…Start hereBefore production
A token, stablecoin, NFT or vaultThe Wizard below, then Fungible, Non-Fungible or VaultPin exact versions (see Add the library)
Regulated assets (permissioned, compliant tokens)Real World Assets and the RWA examplePlan identity and compliance with your issuer
Private balances and transfers (hidden amounts, with auditing)Confidential Token: Start Building, then Build with the SDK on testnetThe contracts are audited; the client SDK isn't yet. Read the best practices
A wallet without seed phrases (passkeys, shared accounts, recovery)Smart Account, Policies and the multisig smart account example (WebAuthn verifier, threshold policies)Your signing client must support the stellar-accounts version you deploy (see the note on client versions)
An agent wallet with spending limitsAgent Wallet on testnet: a context rule scoped to one token, with an expiry and the spending-limit policySame client-version check as above
Gasless transactionsStellar Channels (managed relayer) and Fee AbstractionReview Channels' fair-use terms, or run your own Relayer
Paid APIs over x402The x402 facilitator on ChannelsTest your payer type early: smart-account payers cost more in fees than classic accounts
Governance or a DAOGovernor, Votes, Timelock and the governor exampleChoose voting and timelock parameters deliberately
Proofs and allowlists (Merkle airdrops, membership, voting)Cryptography, Merkle Distributor and the Merkle voting exampleN/A
Admin controls on a classic assetSAC Admin and the wrapper exampleN/A
With a coding agentPoint it at llms.txt, or use the Contracts MCP and OpenZeppelin SkillsReview generated code like any other

All examples build with stellar contract build and deploy with the steps below.

Prototype or production?

Prototyping or building an MVP. Use the library and its examples as they are, on testnet. Client tools that are still in development, such as the Confidential Token SDK, are fine for demos. Build with the SDK and Agent Wallet are complete flows that have been run on testnet.

Going to production. Rely on audited pieces and close the gaps around them:

  • Check the audit reports for what each release covers. The examples are starting points, not production deployments.
  • Pin exact versions, and don't use anything older than 0.7.3 (advisory).
  • Smart accounts: v0.8.0 changed the digest that signers commit to. Use a client that supports the version you deploy.
  • Confidential token: holders need a client that builds proofs. The available SDK is unaudited, so plan for a reviewed client before handling real funds.

Set up your environment

  1. Install Rust and add the Soroban target:

    rustup target add wasm32v1-none
  2. Install the Stellar CLI, version 25.2.0 or later. Contracts built with soroban-sdk 28 need stellar contract build; plain cargo build --target wasm32v1-none fails.

Add the library

Pin exact versions. The library iterates quickly, and minor versions can include breaking changes.

[dependencies]
soroban-sdk = "=28.0.0"
stellar-tokens = "=0.8.0"
stellar-access = "=0.8.0"
stellar-macros = "=0.8.0"

Add only the crates your contract uses: stellar-accounts, stellar-confidential, stellar-contract-utils, stellar-fee-abstraction and stellar-governance are also available.

Add a release profile too. stellar contract build refuses to build without overflow-checks = true; this is the profile the library itself uses:

[profile.release]
opt-level = "z"
overflow-checks = true
debug = 0
strip = "symbols"
debug-assertions = false
panic = "abort"
codegen-units = 1
lto = true

Build and deploy to testnet

stellar contract build
stellar keys generate alice --network testnet --fund
stellar contract deploy \
  --wasm target/wasm32v1-none/release/<your_crate>.wasm \
  --source alice --network testnet \
  -- <constructor arguments>

For complete, deployable contracts, see the examples in the library repository. Each one builds with stellar contract build.

Generate a contract

Use the interactive generator to bootstrap a contract and explore the components in the suite. You can also open it on its own.

Loading OpenZeppelin Contracts Wizard...