Skip to content

feat: Fee-bump / sponsored transactions (gasless registration & claim) #555

Description

@joelpeace48-cell

Background & current state

New users without XLM cannot pay transaction fees, so their very first action (register/claim) fails. Trivela has no fee-sponsorship path; the wallet abstraction (frontend/src/lib/wallet) assumes the user funds their own fees.

Goal

Provide a backend fee-sponsorship service that wraps user transactions in fee-bump transactions (operator pays fees) with strict abuse controls, enabling gasless registration/claim for first-time users.

Technical design

  • Endpoint POST /api/v1/sponsor/fee-bump accepts a signed inner tx; server validates it (only allows Trivela contract ops to known contract IDs), wraps it in a FeeBumpTransaction signed by the sponsor account, and submits.
  • Abuse controls: per-IP + per-identity quotas via the existing rate limiter; allowlist of permitted operations; max fee cap; daily budget with a circuit breaker.
  • Sponsor account health monitored (NEW-016).

Edge cases

  • Inner tx contains non-Trivela ops → reject.
  • Quota exceeded → 429 with Retry-After.
  • Sponsor budget exhausted → 503 + alert; fall back to user-paid.
  • Replay of the same inner tx → dedupe (idempotency, NEW-031).
  • Fee spikes → cap + reject above max.

Task breakdown

  • Fee-bump endpoint + op allowlisting + validation.
  • Quota/budget controls + circuit breaker.
  • Frontend: auto-route first action through sponsorship when user XLM is insufficient.
  • Tests: valid sponsor, disallowed op, quota/budget exhaustion, replay.

Acceptance criteria

  • A user with 0 XLM completes registration via a sponsored tx within quota.
  • Non-Trivela ops and over-quota requests are rejected.

Testing & verification

  • Integration test on testnet with a zero-balance account; quota exhaustion returns 429.

Out of scope

  • Account creation/reserve sponsorship (NEW-021).

Dependencies / related

  • Pairs with NEW-021, NEW-019 (passkeys), NEW-016, NEW-031.

References

  • Stellar fee-bump transactions (CAP-15).

Difficulty: medium · Effort: M · stellar

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea: backendBackend API (Node/Express)difficulty: mediumModerate complexityenhancementNew 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