StellarAddressKit
The deposit routing & address interop spec for Stellar (G/M/C + memos). Implemented across TypeScript, Go, and Dart.
Not an SDK replacement but instead an application-layer routing logic the SDK (Stellar SDK) does not provide; built on top of it. It's specified in spec/vectors.json, and validated identically across all three language implementations (Go, Dart, TypeScript).
Why This Exists
Stellar has three address types that coexist in real payment flows:
| Prefix | Type | Used For | | :--- | :--- | :--- | | G… | Classic account | Standard payments | | M… | Muxed account | Pooled accounts, exchange subaccounts, G address + embedded 64-bit ID | | C… | Contract address | Soroban smart contracts, not a valid destination for classic payment routing |
Routing a deposit correctly requires knowing which type you received, whether to read the routing identifier from the muxed ID or the memo field, and what to do when both are present, or neither. Getting this wrong causes lost deposits.
Routing Reference
| Scenario | routingSource | Warnings | Recommended Action | | :--- | :--- | :--- | :--- | | M address, no memo | muxed | - | Route via muxed ID | | M address + routing memo also present | muxed | MEMO_PRESENT_WITH_MUXED (warn) | Route muxed, investigate sender | | G address + MEMO_ID | memo | - | Route via memo ID | | C address as destination | none | INVALID_DESTINATION (error) | Alert immediately, always |
Warning System
Warnings are separated by ontology:
- ErrorCode: Input could not be parsed (destinationError).
- WarningCode: Input parsed successfully but requires operational attention (warnings[]).
Severity Levels
info: Informational, no action needed.warn: Log and investigate.error: Reject the deposit and alert ops immediately.
Common Integration Mistakes
- Assuming valid StrKey means valid payment destination: A
Caddress (CA7...) is a valid StrKey but is treated asINVALID_DESTINATIONfor classic payment routing. - Using JavaScript Number for muxed IDs: Muxed IDs are uint64. Number silently loses precision above 2^53. The library uses
stringfor all publicroutingIdfields. - Treating MEMO_TEXT as always routable:
MEMO_TEXTis only routable if the value is a non-negative decimal integer.
Learn more about the Stellar Ecosystem at stellar.org