Pinned source and boundary
The normative source is SEP-6 at commit0dc4592cb44dda1943341016f076e9326874daed. The standards baseline records its digest.
Use GET /deposit when the external asset and issued Stellar asset are equivalent. Use optional GET /deposit-exchange when they are non-equivalent and the anchor supports SEP-38. A cross-asset case without advertised deposit-exchange support is unsupported, not a same-asset fallback.
RampSpec tests protocol behavior; it does not send production funds, choose a financial provider for a user, judge KYC sufficiency, or interpret legal availability. Active execution is restricted to an approved controlled testnet target and a capped synthetic off-chain rail.
Prerequisites
Lock these inputs before discovery:- target, network passphrase, SEP-1 document, and
TRANSFER_SERVERorigin; - released backend adapter and schemas, fixture bundle, runner image, and compatible release manifest;
- synthetic customer, authenticated Stellar identity, destination account, asset code and issuer, country profile, and funding method;
- controlled external sender and receiver, maximum amount and fee budget, and explicit transaction approval;
- Horizon/RPC endpoint for the selected network and a ledger-finality policy;
- cleanup, refund, callback, timeout, and incident owners.
Access-Control-Allow-Origin: *. Reject redirects to an unapproved origin, DNS rebinding, private-address resolution, downgrade to HTTP, or discovery data that changes after the run is locked.
Capability discovery
Fetch SEP-1, select the exactTRANSFER_SERVER, then call GET /info. Store canonical response hashes and validate the result before asking for authentication or funding.
For the selected asset_code, inspect:
Choose
funding_method only from the advertised list. The older type parameter and /info.fields are compatibility observations; they cannot replace funding_method or SEP-12 KYC. The /fee endpoint, how response property, wallet name, and wallet URL are deprecated and do not satisfy current cases.
Reject an asset that is missing, disabled, conflicts with SEP-1 currency metadata, or advertises a method the controlled rail cannot execute. Absence of a minimum, maximum, or simple fee means unspecified, not zero.
Authentication
When/info sets authentication_required, obtain a short-lived SEP-10 or SEP-45 JWT and send it as Authorization: Bearer <JWT> to every applicable API endpoint. A missing token should produce 403 with type: authentication_required on initiation.
Record only redacted token claims and a digest. Verify issuer, audience, subject, client domain, network, issued/expiry time, and target binding before use. History and single-transaction queries must return only records owned by the authenticated subject, including its memo identity for a shared account.
The authenticated account identifies the customer, but the deposit destination account may differ. Treat that difference as an explicit, reviewed input; never silently substitute the token subject or a previous destination.
Same-asset deposit
1. Build the request
CallGET /deposit with:
asset_codeexactly matching an enabled/info.depositkey;- destination
accountas a classic, muxed, or contract account on the locked network; - advertised
funding_method; - optional decimal
amount, ISO 3166-1 alpha-3country_code, syntheticcustomer_id, controlled callback, locale, and claimable-balance flag; - optional destination payment
memoandmemo_typeonly when the scenario needs them.
id. Preserve exact account and memo values through initiation, transaction reporting, and ledger correlation.
2. Validate initiation
A successful200 starts processing. Capture the anchor transaction id, instructions, estimated time, limits, simple fees, and extra information. instructions must use SEP-9 financial-account field names with a value and description. Treat all instruction values as sensitive and allow execution only when they resolve to the controlled off-chain destination.
The transaction ID may be absent in the response according to the base schema, but the controlled RampSpec profile requires one because status, KYC, evidence, and cleanup cannot otherwise be correlated safely. Missing ID is therefore a profile failure, clearly distinguished from an upstream schema violation.
Do not fund immediately. Query GET /transaction?id=<id> and wait for pending_user_transfer_start. Use the returned amount_in and current instructions; the final amount can differ from the proposed amount when fees are additive or processing is asynchronous.
3. Complete KYC when requested
If the record isincomplete or pending_customer_info_update, query SEP-12 with this transaction ID and type=sep6. Submit only requested synthetic fields until the customer is ACCEPTED, then poll the SEP-6 transaction again.
Never pass identity or financial-account data through deprecated query fields merely because the target advertises them. A target that supports only that legacy flow is recorded as incompatible with the current RampSpec profile.
4. Fund and settle
After the user-transfer-start state, send the exact approved external amount once, with the required bank, cash, crypto, or other sandbox reference. Bind the external receipt ID to the anchor transaction before polling continues. An unknown submission outcome pauses for reconciliation; it must not trigger an automatic duplicate payment. Observe the anchor detecting external settlement, processing internally, submitting the Stellar transaction, and completing. The destination account must receive the selected asset and memo, subject to the locked amount and fee rules.Cross-asset deposit
Cross-asset testing additionally requires a pinned SEP-38 quote capability and assets expressed in its identification format.- Confirm the Stellar destination asset appears under
/info.deposit-exchangeand the external source asset appears in SEP-38 prices for that destination. - Lock
source_asset, destinationasset_code, funding method, source amount, destination account, and delivery method. - For a market-rate case, initiate without
quote_idand record the rate/amount basis returned over the lifecycle. - For a firm-rate case, obtain a quote through SEP-38, validate its assets, sell amount, buy amount, fee, delivery method, and expiry, then pass its ID to
/deposit-exchangebefore expiry. - Require the initiation request’s source asset, destination asset, amount, and funding method to match the quote. Any mismatch must return
400and create no transaction that is ready for funding. - Complete the same KYC, instruction, external-funding, status, and ledger checks as the same-asset journey.
amount is denominated in the external source_asset and must equal the firm quote’s sell amount. Transaction amount_in_asset, amount_out_asset, and fee asset must use SEP-38 identifiers. A firm-quote transaction must preserve the quote ID and its agreed economics when funds arrive within the quote conditions; an expired quote must not settle at the stale rate.
Amounts, fees, and assets
Parse transaction amounts as decimal strings with at most seven decimal places; never use binary floating-point for comparisons. Preserve asset code and issuer together for Stellar assets, and the complete SEP-38 identifier for exchange assets. For a same-asset transaction, validate after expressing every term in that asset:fee_details.total, asset, and optional itemized amounts to reconcile; when a quote exists, fee details must match it. amount_fee and amount_fee_asset are deprecated compatibility fields and must not override fee_details.
Test exact minimum, exact maximum, below-minimum, above-maximum, zero, negative, excess precision, overflow, malformed decimal, and an amount whose fee would make output invalid. Expected terminal classifications include too_small and too_large; a rejected amount must not produce usable instructions or accept funds.
Transaction states
PollGET /transaction with bounded exponential backoff, or verify signed status callbacks using the anchor’s SEP-1 signing key. History from GET /transactions must be newest-first, honor filters and pagination, and isolate shared-account memos.
pending_user is a generic additional-action state. Require a redacted message or approved more_info_url that identifies the action. user_action_required_by is valid only for a state requiring user action and must trigger no automatic payment after its deadline.
Track only allowed transitions. Timestamps cannot move backward, completed_at appears only on completion, and a terminal record cannot silently return to an active state. Repeated callbacks or polls must not duplicate a state transition or payment.
Destination readiness
Before active funding, check that the destination account exists and has a trust line to the exact asset. Exercise unsupported account creation, supported controlled account creation, missing trust line, issuer authorization, and claimable-balance paths separately. If claimable balances are advertised and requested, requireclaimable_balance_id, a successful creation operation, the intended claimant and predicate, and a completed record. Completion proves creation, not that the user has claimed it. A separate controlled action establishes the trust line and claims the balance when the scenario includes claim completion.
Never assume claimable-balance support merely because SEP-6 recommends it. Capability discovery and the request flag must agree.
Ledger correlation
An anchor’scompleted state is necessary but insufficient. Query the locked Stellar data source and prove:
stellar_transaction_idexists on the selected network and succeeded at the required ledger finality;- the relevant payment, account-creation, or claimable-balance operation targets the exact destination;
- asset code and issuer, amount, memo and memo type, and claimant data match the locked scenario;
- the transaction time follows accepted external funding and fits the run window;
- the transaction hash maps to exactly one anchor record and its
external_transaction_idmaps to the controlled receipt; - the observed balance delta reconciles with amount, fee, conversion, and refund evidence.
Errors and boundaries
Every non-200 response must carry structured error details. Test unsupported asset/method, disabled deposit, missing or invalid parameter, authentication required, KYC denial, quote mismatch/expiry, unsafe callback, missing transaction, cross-account lookup, amount bounds, instruction timeout, external payment failure, ledger failure, and refund.
The runner must fail closed before value transfer when errors conflict with usable instructions. After value has moved, it must stop new actions, reconcile both rails, and follow the controlled target’s refund procedure. A refund record includes total returned, total refund fee, and payment entries whose amounts and fees sum exactly to the totals.
Do not test withdrawals, SEP-24 interactive flows, production banks or blockchains, unsupported asset pairs, arbitrary callback destinations, automatic trust lines on behalf of a user, or irreversible transfers outside the approved budget. These are explicit exclusions, not skipped successes.
Evidence record
Each case records discovery and release digests, target/network, authentication class, customer/transaction fixture IDs, deposit kind, assets, issuer, funding method, quote ID and expiry, requested and actual decimal amounts, fee/refund reconciliation, redacted instruction digest, status timeline, callback verification, external receipt ID, Stellar transaction and ledger coordinates, destination observation, retry count, and cleanup outcome. Redact bearer tokens, customer fields, bank/crypto instructions, full external accounts, callback bodies, and all secret material before persistence. Evidence distinguishes target claims, external-rail observations, and independently queried Stellar facts.Findings and remediation
Authentication bypass, sensitive-data exposure, quote/accounting failure, unsafe destinations, record isolation, duplicate payment risk, and false completion are release blockers.