We use necessary cookies for site function. For analytics and marketing, we need your consent. You can change your mind anytime. Privacy Policy
Olvis Gil · November 16, 2026 · 8 min readStellar’s SDK story has a gap: JavaScript, Go, Rust, Java, Python — but no modern C++ option for the huge world of software already written in it. stellar-cpp-sdk fills it: an Apache-2.0, C++20 SDK built from scratch on SDF’s canonical xdr.json AST, with a Result<T> error model, a synchronous thread-safe API, and live-testnet verification. It already speaks Protocol 30 — the Bell upgrade — including the new W address type for muxed contract accounts.
Trading systems, game engines, embedded devices, payment terminals, and a lot of financial infrastructure run on C++ — and those teams shouldn’t have to shell out to another language’s CLI to touch the network. The SDK is designed for exactly that: private dependencies (libsodium, libcurl, pugixml) never leak into public headers, so it drops into an existing CMake project without dependency drama.
Full XDR layer. 495 definitions generated from stellar-xdr v30.0.0, a strict big-endian codec with depth and length limits, a runtime type registry, and a stellar-xdr-cpp CLI for inspecting XDR on the command line. Core primitives. All ten SEP-23 strkey kinds — including CAP-84 W muxed contracts — libsodium Ed25519 keys, fixed-point Amount/Price/128–256-bit integers, SEP-5 mnemonics, and SEP-53 message signing. Transactions. A TransactionBuilder with mandatory time bounds (unless you explicitly opt out), all 27 operation factories, fee-bump envelopes, CAP-40 signed payloads, and hash-x signatures — verified byte-for-byte against stellar-base across a 32-case compatibility matrix.
Stellar RPC. All 13 methods including queryEvents/getTransactions, parsed by the SDK’s own strict JSON layer (zero external JSON dependency), plus streaming with cancellation, a retrying transport that honors Retry-After, and a send_and_poll helper that handles TRY_AGAIN_LATER and DUPLICATE correctly. Soroban contracts. ScVal construction with canonical sorting, a ContractClient for call/invoke/deploy with fee-bump and auto-restore options, authorization signing across all three credential arms (including CAP-71-01 delegation trees), a WASM custom-section metadata reader, and spec-driven JSON arguments — plus a TokenClient for SEP-41 tokens.
ISO 20022 (optional component). Emit and parse pacs.008/002/004, pain.001/002, and camt.053/054 XML mapped to Stellar payments — batch totals, UETRs, and status-report reconciliation — validated against the official XSDs vendored in the repo. If you work where blockchain meets banking messages, this alone is unusual.
#include <stellar/sdk.hpp>
using namespace stellar;
// keys + network (always explicit — no global default)
STELLAR_TRY_ASSIGN(kp, KeyPair::from_secret(secret_seed));
Network net = Network::testnet();
// transactions
TransactionBuilder tx(kp.account_id());
tx.sequence_number(123).fee(100).time_bounds(0, 3600)
.add_operation(ops::payment(dest, Asset::native(),
*Amount::parse("10")));
STELLAR_TRY_ASSIGN(built, tx.build());
auto env = TransactionEnvelope::of_transaction(*built);
env.sign(*kp, net);
// RPC
CurlTransport http;
RpcClient rpc(http, "https://soroban-testnet.stellar.org");
STELLAR_TRY_ASSIGN(sent, rpc.send_and_poll(env));
// contracts (spec-driven)
ContractClient cc(rpc, net, "C...CONTRACT_ID");
cc.set_spec(*ContractSpec::decode(meta.spec_entries_xdr));
auto r = cc.call_json(kp.account_id(), "transfer",
Json::parse(R"({"to":"G...","amount":"100"})").value());CMake presets keep it one line: cmake --preset dev && cmake --build --preset dev && ctest --preset dev. You need CMake 3.24+ and a C++20 compiler (GCC 11+, Clang 14+, MSVC 2022+). Dependencies — libsodium, libcurl, pugixml — come via vcpkg automatically, or via your package manager (brew install libsodium curl pugixml). Prefer vcpkg for the SDK itself? The repo ships a port, so vcpkg install stellar-cpp-sdk plus find_package(StellarSdk COMPONENTS core xdr rpc) works out of the box.
This is an early release with the foundations done: 84/84 unit tests plus five live-testnet integration tests green on dev and asan-ubsan presets. Horizon REST/SSE streaming and the wallet/anchor SEPs are the next phases. For a codebase this young, the verification posture is refreshingly serious — fixture matrices against stellar-base, fuzz presets, and a generated RPC conformance matrix in compatibility/.
stellar-cpp-sdk on GitHub · Stellar Go CLI · Build Stellar apps with Go · Bell, Protocol 30 · Stellar hub · Stellar Network masterclass

Founder of EduNode and OG Technologies EU — a Vienna consultancy for blockchain payments, tokenization, digital identity, and ISO 20022.