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).

0.

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.

0.

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 |

0.

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.
0.

Common Integration Mistakes

  • Assuming valid StrKey means valid payment destination: A C address (CA7...) is a valid StrKey but is treated as INVALID_DESTINATION for classic payment routing.
  • Using JavaScript Number for muxed IDs: Muxed IDs are uint64. Number silently loses precision above 2^53. The library uses string for all public routingId fields.
  • Treating MEMO_TEXT as always routable: MEMO_TEXT is only routable if the value is a non-negative decimal integer.