Repository navigation
Description
Protocol 27: SDK Changes
XDR Changes
- XDR should be upgraded to stellar-xdr@
68fa1ac(the Protocol 27 XDR). The headline change is CAP-71, which adds
two new address-bound Soroban authorization credential types. TheSorobanCredentialsTypeenum gains two arms:SOROBAN_CREDENTIALS_ADDRESS_V2 = 2— carries the identicalSorobanAddressCredentialspayload as the legacyADDRESS, but binds the credential address into the signed payload.SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES = 3— wrapsSorobanAddressCredentialstogether with a (recursively nested) tree ofSorobanDelegateSignaturefor delegated / multi-party signing.
- A new
HashIdPreimagearm,ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS, is added. It is the legacy Soroban-auth preimage plus anSCAddress addressfield:
case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS:
struct {
Hash networkID;
int64 nonce;
uint32 signatureExpirationLedger;
SCAddress address; // NEW — binds the signer's address
SorobanAuthorizedInvocation invocation;
} sorobanAuthorizationWithAddress;- New supporting structs:
struct SorobanDelegateSignature {
SCAddress address;
SCVal signature;
SorobanDelegateSignature nestedDelegates<>;
};
struct SorobanAddressCredentialsWithDelegates {
SorobanAddressCredentials addressCredentials;
SorobanDelegateSignature delegates<>;
};Authorization signing — pick the preimage from the credential type. Code that hardcodes ENVELOPE_TYPE_SOROBAN_AUTHORIZATION when building the signature payload is wrong for the new types. Branch on the credential arm:
* ADDRESS → ENVELOPE_TYPE_SOROBAN_AUTHORIZATION (unchanged, not address-bound)
* ADDRESS_V2 and ADDRESS_WITH_DELEGATES → ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS
Reading credentials. Handle the two new union arms anywhere you unpack SorobanCredentials (e.g. a helper that extracts the inner SorobanAddressCredentials regardless of which arm carries it).
Delegated auth (ADDRESS_WITH_DELEGATES, CAP-71-01). Every signer — the top-level account and each (nested) delegate — signs the same payload, bound to the top-level address. Each delegate array must be sorted by address ascending with duplicates rejected, or
the host rejects the entry. Simulation never emits this variant on its own; which accounts use delegated auth is client-side policy (like a multisig policy), so the SDK ships low-level primitives and the client assembles the tree.
Default to legacy ADDRESS — make V2 opt-in. ADDRESS_V2 is only valid on networks that have upgraded to protocol 27; emitting it before a network upgrades fails submission. Keep ADDRESS as the default and gate V2 behind an opt-in flag. The default should flip to V2 once Protocol 28
makes it mandatory.
RPC Changes
simulateTransactiongains an opt-in request flag to ask simulation to returnADDRESS_V2credentials instead of legacyADDRESS:
// simulateTransaction params
{
"transaction": "<base64 TX>",
"authMode": "enforce" | "record" | "record_allow_nonroot", // existing
"authV2": true // NEW, optional — request ADDRESS_V2 auth entries.
// Omit (default) → simulation returns legacy ADDRESS entries.
}RPC ignores request fields it doesn't recognize. Sending authV2: true to an RPC that hasn't been updated is a silent no-op: it returns legacy ADDRESS (V1) credentials with no error. So you can't detect support from an error — if you need to know whether you actually got V2 back, inspect the credential arm of the returned entries rather than assuming the flag took effect.
XDR Generation (xdrgen users)
If you generate your XDR types with xdrgen, note that the canonical .x files now contain feature-gated content (preprocessor directives) that xdrgen does not understand. Before running xdrgen, preprocess each .x file with the
stellar-xdr CLI to expand the feature gates, then feed the preprocessed output to xdrgen. For each downloaded .x file:
stellar-xdr xfile preprocess --features "$(XDR_FEATURES)" $@ > $@.pp && mv -f $@.pp $@XDR_FEATURES selects which feature set to enable. Protocol 27 features have already been ungated so leaving this empty will return you only xdr types which are relevant for protocol 27.
Reference Implementations
- [
js-stellar-sdk] — see PR-1 PR-2src/base/auth.ts(authorizeEntry,authorizeInvocation,buildAuthorizationEntryPreimage,buildWithDelegatesEntry,getAddressCredentials) andsrc/rpc/server.ts
(thesimulateTransactionauthV2flag). stellar-rpc
Activity
Ryang-21 commentedon Jun 15, 2026
Follow-up correction: please disregard the RPC Changes section for now. Those aren't confirmed yet.
Specifically, hold off on:
authV2: trueopt-in flag forsimulateTransactionADDRESSentriesEverything else in the issue is still accurate and good to build against — the XDR changes (CAP-71 credential types, the new
HashIdPreimagearm, preimage selection by credential type, delegated auth handling) and the xdrgen preprocessing steps.I'll via a comment or a new issue to confirm once the RPC changes have actually landed, at which point you can implement that section. Thanks for your patience.
overcat commentedon Jun 17, 2026
Included in 4.0.0-beta0
gologo13 commentedon Jun 25, 2026
@overcat Hi, thank you for releasing 4.0.0-beta0 and adding Protocol 27 (CAP-71) support.
Do you have any plan or rough timeline for the official 4.0.0 release (non-beta)?
overcat commentedon Jun 26, 2026
Hi @gologo13, SDF is still rolling out updates related to Protocol 27, and I hope to release the official version next week.
yo-yamaguchi-ftca commentedon Jul 3, 2026
Hi @overcat, thanks again for your work on Protocol 27.
With the mainnet upgrade vote on July 8, could you share whether you still expect the non‑beta 4.0.0 release today, or if the timeline has changed?
Thanks!
overcat commentedon Jul 4, 2026
4.0.0 has been released.
I'd like to add that even if the mainnet has upgraded to 27, the previous SDK will still work normally; Stellar's upgrades generally do not break old features.