Skip to content

feat: Soroban auth-entry batching (single approval for multi-step flows) #557

Description

@joelpeace48-cell

Background & current state

Multi-step user flows (e.g., register → credit → claim, or approve → spend) can require multiple signatures, hurting UX. Soroban auth entries can sometimes be composed so a user approves once. The frontend currently signs each step separately.

Goal

Compose multiple contract authorizations into a single user approval where the protocol allows, reducing signature prompts in multi-step flows.

Technical design

  • Build a single transaction with multiple Soroban operations / InvokeHostFunction auth entries, collect the required SorobanAuthorizationEntrys, and have the user sign them in one prompt via the wallet provider.
  • Provide a helper in the SDK/frontend (composeAuth(entries)); fall back to sequential signing where composition isn't valid.

Edge cases

  • Operations requiring different signers → can't compose; fall back.
  • Auth-entry expiry (signatureExpirationLedger) → set sensibly; handle expiry mid-flow.
  • Simulation needed per op to build correct auth → ensure ordering/nonce correctness.
  • Partial failure within a composed tx → all-or-nothing semantics; communicate clearly.

Task breakdown

  • Auth-entry composition helper + simulation.
  • Wallet provider single-prompt signing of multiple entries.
  • Fallback to sequential signing when invalid.
  • E2E measuring signature prompts before/after.

Acceptance criteria

  • A representative multi-step flow requires one signature instead of N where composable.
  • Non-composable flows fall back correctly.

Testing & verification

  • E2E counting wallet prompts pre/post; unit tests for composition + expiry.

Out of scope

  • Protocol changes; cross-wallet differences beyond the abstraction.

Dependencies / related

  • Benefits all multi-step flows; relates to SDK (NEW-085).

References

  • Soroban authorization framework; auth entries.

Difficulty: medium · Effort: M · dx

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea: frontendFrontend (React/Vite)difficulty: mediumModerate complexitydxDeveloper experienceenhancementNew feature or requeststellarStellar/Soroban integration

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