# SEP: Trustline Onboarding #1956
sogobanwo
started this conversation in
Stellar Ecosystem Proposals
Replies: 1 comment
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
SEP: Trustline Onboarding
Preamble
Simple Summary
A standard way for exchanges, brokers, custodians, and wallets to move a Stellar classic asset to
a user who has no trustline for it — without the user manually creating a trustline and without the
user holding XLM for the trustline reserve. The standard defines the transactions, the issuer
authorization interface for regulated assets, the discovery metadata, and the redirect ("activate
assets") hand-off, so that any participant can implement the flow predictably.
Dependencies
This SEP composes existing, finalized protocol features and ecosystem standards. It introduces no
new protocol change and depends on:
SetTrustLineFlagsoperation.This SEP uses
SetTrustLineFlagsto authorize a trustline in the regulated profile (setting theAUTHORIZEDflag) and, in the regulated lifecycle, to claw back issued amounts.AUTH_REQUIREDandAUTH_REVOCABLEaccount flags (base protocol) define the regulatedprofile; CAP-0018 (Fine-Grained Control of Authorization, Protocol 13) is the relevant
authorization model (informative).
stellar.toml, for discovery./tx-approverequest/response shape this SEP reuses forissuer authorization.
verification hooks for the regulated profile (informative).
CAP-0073 (Authorize Trustline) and CAP-0032 are forward-looking optimizations that would
let an issuer pre-authorize a trustline at the protocol level. This SEP is designed so that an
implementation can adopt them later behind the same interface, but does not depend on them.
Motivation
Receiving a classic Stellar asset requires the recipient's account to hold an authorized trustline
for that asset. This creates two recurring blockers:
prompt by their wallet or exchange. Withdrawal flows stall, and support burden rises. Exchanges
and institutional partners cannot offer a predictable native-asset withdrawal experience.
AUTH_REQUIRED: the issuer has to authorize each trustline. There is no agreed interface for anexchange or wallet to request that authorization as part of onboarding, so each integration is
bespoke.
Point solutions exist, but no standard does, so custodians, wallets, exchanges, and issuers cannot
interoperate. This SEP specifies the flow end to end so they can.
Abstract
An asset is delivered to a trustline-less recipient through one of three mechanisms:
asset, authorize it), so the recipient can hold the asset. Useful when the recipient must hold
before a transfer arrives.
(OPTIONAL; informative in this version).
recipient (who needs no trustline yet); the recipient later claims it with a sponsored
trustline, in a single transaction.
Each mechanism has an unregulated and a regulated profile. A regulated profile inserts an
issuer authorization operation that the issuer signs through a SEP-8-aligned approval server.
A sponsor account pays every reserve via CAP-33 sponsorship, so the recipient needs no XLM.
Signatures are collected from the parties that own the keys — the recipient (their wallet), the
sponsor (the onboarding service), and, for regulated assets, the issuer (its approval server) — and
no party holds another party's key. Implementations discover an asset's profile and approval
server from the issuer's
stellar.toml, and MAY offer a hosted redirect ("activate assets") pageparameterized by a documented set of query parameters.
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
RFC 2119.
All transactions are classic Stellar transactions. All XDR is base64-encoded transaction
envelopes.
G...denotes a Stellar public key (MuxedAccounts are out of scope for this version).1. Roles
typically in a wallet.
G....to Mechanism C.
server.
onboarding service.
transactions and coordinates signatures. It MUST NOT hold the recipient's or issuer's keys.
2. Asset profiles
An asset is one of:
AUTH_REQUIRED. A trustline can hold the asset as soonas it exists.
AUTH_REQUIRED(and typicallyAUTH_REVOCABLE, and MAY enableclawback). A trustline MUST be authorized by the issuer before it can hold the asset.
An onboarding service MUST determine the profile authoritatively from the issuer account's
flags(
auth_required) as reported by Horizon, and MUST NOT rely solely on cachedstellar.tomlmetadata when deciding whether issuer authorization is required.
3. The sponsorship sandwich
Operations that create reserves for the recipient MUST be wrapped so the sponsor pays, per
CAP-33:
The
Beginoperation is sourced by the sponsor; theEndoperation MUST be sourced by thesponsored account. Both the sponsor and the sponsored account therefore MUST sign the transaction.
4. Mechanisms
The transaction source account provides the fee and sequence number. Unless stated otherwise, the
source is the recipient. Operation sources are listed explicitly; an operation with no listed
source inherits the transaction source.
4.1 Mechanism A — Authorize (sponsored trustline)
Establishes a sponsored trustline for the recipient. For a regulated asset, the issuer authorizes
it in the same transaction.
Unregulated:
Required signers:
{ sponsor, recipient }.Regulated (adds the issuer authorization):
Required signers:
{ sponsor, recipient, issuer }. The index of theSetTrustLineFlagsoperationMUST be communicated to the caller so the approval server can locate the operation it
signs.
4.2 Mechanism C — Claimable balance
Sender side — create a claimable balance to a recipient who has no trustline:
Required signers:
{ sender }. The resulting balance id is derivable from the built (unsigned)transaction and MUST be conveyed to the recipient out of band.
predicateSHOULD beunconditionalfor a plain "send now, claim anytime" flow. An implementationMAY use
BEFORE_RELATIVE_TIME(window)to bound the claim and grant the sender a reclaim path afterthe window, as shown.
Recipient side, unregulated — claim with a sponsored trustline in one transaction:
Required signers:
{ sponsor, recipient }.Recipient side, regulated — the issuer MUST authorize the trustline before the claim:
Required signers:
{ sponsor, recipient, issuer }.4.3 Mechanism B — Intermediate account (OPTIONAL)
An implementation MAY route a transfer through a temporary account that already trusts the asset,
forward the asset to the recipient once the recipient's trustline exists, and then merge the
temporary account. This version specifies Mechanisms A and C normatively; Mechanism B is
informative and reserved for a future revision.
5. The onboarding request (transaction build contract)
An onboarding service builds a transaction for one of the mechanisms above. The request identifies:
assetcodeand theissueraccount.accountG....sponsorG...that pays the reserve.balanceIdmechanismbalanceId.limitThe service MUST return, alongside the unsigned transaction XDR:
network— the network passphrase the transaction is built for;requiredSigners— the set of accounts whose signatures are still required;mechanism— the mechanism used;issuerAuthOpIndex— the index of the issuer authorization operation, present iff the assetis regulated.
The recipient account MUST exist on-chain to be the transaction source. For a brand-new recipient,
the service MAY first sponsor a
CreateAccount(out of scope for this version's normative text; seeSecurity Concerns).
6. Redirect ("activate assets") parameters
A sender (exchange/broker) MAY hand a user to a hosted activation page instead of building the
transaction itself. The hand-off is an HTTP(S) URL whose query parameters are:
assetEURC.issuerG....destinationG....amountbalanceIdreturnUrlplatformlogoprimary#RRGGBB(display).Receivers MUST validate and sanitize every parameter and MUST treat unknown or malformed values as
absent.
logoandprimaryare presentation-only and MUST NOT affect transaction construction.Implementations SHOULD encode
#as%23inprimary.7. Issuer authorization (regulated assets)
For a regulated asset, the issuer authorization operation MUST be signed by the issuer. The
onboarding service obtains that signature from the issuer's approval server, following the
SEP-8
/tx-approvestatus semantics. This profile specifies a JSON transport; an approvalserver that also implements SEP-8's form-encoded transport SHOULD accept both.
Request —
POST {approval_server}withContent-Type: application/json:{ "tx": "<base64 transaction envelope>" }Response — a JSON object with a
statusfield, interpreted as in SEP-8:statussuccesstxis signed.tx.revisedtxis the revised, signed transaction.tx.pendingaction_requiredrejectederrordescribes why.The approval server:
sign only the issuer authorization operation(s) (
SetTrustLineFlagssettingAUTHORIZED) forits own asset. It MUST NOT sign any operation that moves user funds, and MUST reject a
SetTrustLineFlagsthat sets any flag other thanAUTHORIZED.maxTime(expiry), so the issuer signature cannot bereplayed indefinitely.
passed it MUST return
action_required(orpending).MUST NOT be signed or audited more than once. Keying on the transaction hash (which is stable
across signing) is RECOMMENDED.
Because an
action_required/pending/rejectedoutcome may revise the transaction, issuerapproval MUST be obtained before the recipient and sponsor sign.
8. Discovery
An onboarding service discovers an asset's profile and approval server from the issuer's
stellar.toml(SEP-1), located via the issuer account'shome_domain.The issuer's
stellar.toml[[CURRENCIES]]entry for the asset:codeandissuer.regulated = trueand provideapproval_server(a fullyqualified URL), per SEP-8.
onboarding_server— the endpoint that builds onboarding transactions (when the issuer hostsone);
onboarding_mechanisms— an array drawn from["authorize", "claimable", "intermediate"].A consumer SHOULD treat a relative
approval_servervalue as relative to the issuer's home domain,but issuers MUST publish absolute URLs per SEP-8.
9. Signing and submission
Signatures are independent in Stellar and MAY be added in any order, except that a regulated
transaction MUST be sent to the approval server first, because approval MAY revise it. The
RECOMMENDED order is:
(possibly revised) transaction thereafter.
An implementation MAY collect the sponsor signature at build time and the recipient signature last;
the only hard ordering constraint is that issuer approval precedes any signature that would be
invalidated by a revision. No participant MUST ever transmit a private key to another participant.
The sponsor MAY also be the fee source via a fee-bump transaction so the recipient pays no XLM at
all; otherwise the recipient's account is the fee source and pays only the (negligible) network
fee.
10. Outcomes
An onboarding implementation MUST surface these terminal outcomes to the user. The codes are
normative; their presentation is not.
successkycaction_required/pending).rejectedrejected).expiredno-walletfailedA caller verifies success by confirming the recipient holds an authorized trustline for the asset
(e.g. via Horizon
accountsbalances: the asset line is present and, for a regulated asset,is_authorizedis true).11. Regulated lifecycle (MiCA)
The regulated profile makes a MiCA-compliant lifecycle possible. Beyond onboarding authorization,
the issuer (through privileged, authenticated operations on its own account — NOT part of the
onboarding flow) MAY:
SetTrustLineFlagsclearingAUTHORIZED, whichrequires the issuer to have set
AUTH_REVOCABLE), andClawback, CAP-35) when the issuer enabled clawback.These operations MUST be authenticated and audited, and MUST be reachable only by the issuer. They
are specified here only to establish that the authorization layer this SEP defines is sufficient for
the full regulated asset lifecycle.
Design Rationale
Why a sponsored trustline rather than requiring XLM. The reserve requirement is the friction.
CAP-33 lets a sponsor pay it transparently, so the recipient needs no XLM and sees no reserve. The
sponsorship sandwich is the minimal, finalized way to express this and requires only the sponsor and
sponsored signatures.
Why claimable balances as the universal default. Mechanism C lets value be sent now to a
recipient who has no trustline at all, decoupling the transfer from onboarding. It works today on
mainnet with no protocol change and degrades gracefully: the recipient claims whenever they are
ready, paying no reserve.
Why reuse SEP-8 for issuer authorization. Regulated assets already have a standard approval
interface in SEP-8. Rather than invent a parallel one, this SEP constrains SEP-8 to the onboarding
case: the approval server signs only the issuer authorization operation, gates on KYC, and is
idempotent. Existing SEP-8 tooling and mental models carry over.
Why bring-your-own sponsor and no hosted signing oracle. The sponsor pays real reserves. A
remote "sign/sponsor this for me" endpoint callable by anyone is a signing oracle that could be
spammed to exhaust the sponsor's XLM or coax unintended signatures. The standard therefore keeps
sponsorship a local responsibility of the onboarding service. A party that cannot run a sponsor uses
the redirect hand-off to a hosted page that sponsors within its own gated session, never an
open API.
Why issuer approval before other signatures. SEP-8 approval may revise the transaction
(
revised), which invalidates any prior signature. Ordering approval first avoids re-collection.Why CAP-73 is a dependency-free optimization. CAP-73 / CAP-32 would let an issuer pre-authorize
a trustline at the protocol level, removing the per-onboarding
SetTrustLineFlagsround-trip. Theyare draft. This SEP authorizes at trustline-creation time using the finalized
SetTrustLineFlagsoperation (CAP-35), and is structured (
issuerAuthOpIndex, the approval interface) so animplementation can switch to a protocol-level path behind the same surface once those CAPs land.
Why the redirect parameters are presentation-agnostic. Branding parameters (
logo,primary)never influence transaction construction, so a malicious referrer cannot use them to alter what is
signed — only how the page looks.
Security Concerns
oracle. Implementations MUST gate such endpoints (origin allow-listing, rate limiting,
per-destination caps, and ideally session binding or proof-of-work) and SHOULD monitor sponsor
balance and provide a kill switch. The standard's "no hosted sponsorship API" stance (Design
Rationale) is the primary mitigation.
issuer's keys. The recipient signs in their wallet; the issuer signs in its approval server,
which SHOULD keep the issuer key in an HSM/KMS. The sponsor key SHOULD likewise be HSM/KMS-backed
in production.
(not just the operation it signs), MUST sign only its own
SetTrustLineFlagsoperation, and MUSTbe idempotent/replay-protected to avoid double authorization or audit.
Sponsoring
CreateAccountfor brand-new accounts and/or using a sponsor fee-bump avoids therecipient needing any XLM; implementations that omit these MUST clearly document the residual XLM
requirement.
evaluate the claimant predicate (
unconditional,abs_before, composites) against current time;a predicate that is not yet (or no longer) satisfied MUST NOT be presented as immediately
claimable.
"secured by" provenance clear and MUST validate
returnUrl/destination/issuerbefore actingon them.
is inherent to the regulated profile and MUST be disclosed by integrators as appropriate.
Changelog
0.1.0(2026-06-11) — Initial draft. Mechanisms A and C (unregulated and regulated profiles),the sponsorship sandwich, the SEP-8-aligned issuer-authorization interface,
stellar.tomldiscovery fields, the redirect parameters, the signing/submission ordering, and the
outcome/security model. Mechanism B reserved as informative.
Implementations
@trustline-onboarder/*(Apache-2.0):core— transaction builders for Mechanisms A and C, both profiles.approval-server— the SEP-8-aligned issuer authorization server, with compliance gating,idempotency, audit, and the regulated lifecycle operations.
sdk— the adopter SDK: detect, build, submit, verify, asset/claimable discovery, and theredirect builder.
activation-ui— the hosted "Welcome to Stellar" activation page.examples/— runnable wallet and exchange integrations.All reactions