Skip to content

Stellar custom-asset (issued token) send builder #7

@truthixify

Description

@truthixify

Labels: Stellar Wave, stellar, feature, drips, help-wanted
Tier: L (1–2 weeks)
Type: feature

Context

The Stellar chain module currently builds stealth payments for native XLM. Real Stellar usage involves issued assets: USDC (issued by Circle on Stellar), bridged tokens, and project-specific tokens. Without custom-asset support, Wraith on Stellar is a "send XLM privately" tool, not a "send anything privately" tool.

Scope

Add a builder buildSendStellarAsset to sdk/src/chains/stellar/builders.ts (create if missing). It must:

  1. Accept { recipientMetaAddress, amount, asset: { code: string, issuer: string }, sourceAccount, options? }.
  2. Verify the recipient stealth address has a trustline for the asset, OR include trustline-establishment as part of the transaction:
    • Option A: Build a single tx with ChangeTrust + Payment ops, signed by both source and stealth account.
    • Option B: Use a fee-bump pattern where source funds the stealth account first, then pays.
    • Picking the right model is part of the issue; argue both in the PR.
  3. Build the Stellar transaction with both the payment and the announcement (Soroban call), atomically.
  4. Return the same { transaction, stealthAddress, ephemeralPubKey, viewTag } shape the existing XLM builder uses, so consumers can stay consistent.

Open design questions

  • Trustlines cost reserve. Who pays it? Should the stealth address need to be pre-funded to hold a trustline before receiving?
  • Asset code validation — Stellar codes are 4 or 12 characters. Validate before building.
  • Issuer address validation — must be a valid G... strkey.
  • Authorization-required assets — if the issuer requires authorization (authRequired), the stealth address can't receive. Detect and error out cleanly.

Acceptance criteria

  • buildSendStellarAsset implemented.
  • Unit tests covering: trustline present, trustline absent (auto-create or error), invalid asset code, invalid issuer, auth-required asset rejection.
  • Integration test against testnet with a real testnet-issued asset (use a token deployed for this purpose; document the issuer).
  • Demo follow-up issue filed for adding asset selection in the UI.
  • Spectre follow-up issue filed for connector-level support.
  • Docs updated (docs/sdk/chains/stellar.mdx) with examples.

Why this matters

USDC on Stellar is the closest thing to "money" most users care about. Without it, Stellar Wraith is a demo. With it, Wraith is a payments product.

Files

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdripsFunded via Drips NetworkfeatureNew feature workhelp wantedExtra attention is neededstellarTouches Stellar / Soroban code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions