Skip to content

feat: add SEP-10 and SEP-24 anchor integration commands#26

Merged
Nanle-code merged 1 commit into
StarsForges:masterfrom
Emmy123222:feat/sep-10-sep-24
Jun 20, 2026
Merged

feat: add SEP-10 and SEP-24 anchor integration commands#26
Nanle-code merged 1 commit into
StarsForges:masterfrom
Emmy123222:feat/sep-10-sep-24

Conversation

@Emmy123222

Copy link
Copy Markdown
Contributor

Overview

StarForge is positioned as a full developer toolkit for Stellar, but had no tooling for Stellar Ecosystem Proposals (SEPs) — the integration protocols every real Stellar application depends on. This PR adds the two most universally needed SEPs: SEP-10 (Web Authentication) and SEP-24 (Hosted Deposits/Withdrawals), along with a shared stellar.toml parser utility.


What's Changed

src/utils/stellar_toml.rs — Shared stellar.toml Parser

A new utility that fetches and parses https://<domain>/.well-known/stellar.toml, extracting:

  • WEB_AUTH_ENDPOINT
  • TRANSFER_SERVER_SEP0024
  • NETWORK_PASSPHRASE
  • SIGNING_KEY

Used by both SEP-10 and SEP-24 flows.


starforge sep auth — SEP-10 Web Authentication

starforge sep auth --anchor testanchor.stellar.org --wallet alice

Flow:

  1. Fetches stellar.toml from the anchor domain → reads WEB_AUTH_ENDPOINT
  2. GET WEB_AUTH_ENDPOINT?account=<pubkey> → receives challenge {transaction, network_passphrase}
  3. Decodes and verifies the challenge XDR:
    • First operation is manage_data with key "<anchor> auth" and 64-byte nonce
    • Time bounds are present and not expired
  4. Computes the Stellar signing hash: sha256(sha256(passphrase) || ENVELOPE_TYPE_TX || tx_body_xdr)
  5. Signs with the local wallet key (supports encrypted wallets — prompts for password)
  6. Adds DecoratedSignature to the envelope and POSTs back to the anchor
  7. Receives JWT and stores it in ~/.starforge/data/sep10_tokens.json keyed by anchor domain

starforge sep deposit — SEP-24 Hosted Deposit

starforge sep deposit --anchor testanchor.stellar.org --asset USDC --amount 100 --wallet alice

Flow:

  1. Loads stored SEP-10 JWT for the anchor (runs sep auth automatically if none stored)
  2. Fetches stellar.toml → reads TRANSFER_SERVER_SEP0024
  3. POSTs to /transactions/deposit/interactive with Authorization: Bearer <jwt>
  4. Opens the returned interactive URL in the system browser (xdg-open on Linux, open on macOS)
  5. Polls /transaction?id=<tx_id> every 5 seconds (up to 2 minutes) until completed, error, or failed

Files Changed

File Change
src/utils/stellar_toml.rs New — stellar.toml fetch + parse utility
src/commands/sep.rs New — SEP-10 auth + SEP-24 deposit implementation
src/commands/mod.rs Add pub mod sep
src/utils/mod.rs Add pub mod stellar_toml
src/main.rs Add Sep to Commands enum, dispatch, and telemetry

Close #19

Implements `starforge sep auth` (SEP-10 Web Authentication) and
`starforge sep deposit` (SEP-24 Hosted Deposits) with a shared
StellarToml parser utility in src/utils/stellar_toml.rs.

SEP-10 fetches the challenge XDR from WEB_AUTH_ENDPOINT, verifies
manage_data ops and time bounds, signs with the local wallet key,
and stores the returned JWT in ~/.starforge/data/sep10_tokens.json.

SEP-24 uses the stored JWT to POST to TRANSFER_SERVER_SEP0024,
opens the interactive deposit URL in the system browser, and polls
the transaction status endpoint until completion.
@Nanle-code Nanle-code merged commit 9cb576b into StarsForges:master Jun 20, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Stellar SEP Support (SEP-10 Web Auth and SEP-24 Hosted Transfers)

2 participants