| Crates.io | stellar-fee-abstraction |
| lib.rs | stellar-fee-abstraction |
| version | 0.6.0 |
| created_at | 2026-01-21 13:06:27.297924+00 |
| updated_at | 2026-01-21 13:06:27.297924+00 |
| description | Fee abstraction utilities for Stellar contracts. |
| homepage | |
| repository | https://github.com/OpenZeppelin/stellar-contracts |
| max_upload_size | |
| id | 2059122 |
| size | 81,153 |
Utilities for implementing fee abstraction (fee forwarding) for interacting with Soroban contracts, allowing users to pay transaction fees in tokens (e.g., USDC) instead of native XLM.
Fee abstraction enables a better UX by letting users pay for transactions with tokens they already hold. Another actor, called relayer, covers the XLM network fees and is compensated in the user's chosen token.
The flow involves an off-chain negotiation between the user and a relayer (quote request, fee agreement), but the actual execution happens through an intermediary contract called FeeForwarder. This contract enforces that the user is charged at most max_fee_amount (the cap they signed). The relayer determines the actual fee_amount at submission time based on network conditions, but can never exceed the user's authorized maximum.
sequenceDiagram
actor User
actor Relayer
participant FeeForwarder
participant Token
participant Target Contract
User->>User: 1. Prepare call to Target.target_fn()
User->>Relayer: 2. Request quote (fee token, expiration, target)
Relayer-->>User: Quote: max_fee_amount
User->>User: 3. Sign authorization for FeeForwarder.forward()<br/>including subinvocations for:<br/> Token.approve() and Target.target_fn()
User->>Relayer: 4. Hand over signed authorization entry
Relayer->>Relayer: 5. Verify params satisfy requirements<br/>(fee amount, token, fee recipient, ...)
Relayer->>Relayer: 6. Sign as source_account
Relayer->>FeeForwarder: 7. Execute forward():<br/>submit a tx and pay XLM fees
FeeForwarder->>FeeForwarder: 8. Validate authorizations
FeeForwarder->>Token: 9. Approve max fee amount (optional)
FeeForwarder->>Token: 10. Transfer fee amount to fee recipient
FeeForwarder->>Target Contract: 11. Invoke target_fn(target_args)
Target Contract-->>User: Result
Add this to your Cargo.toml:
[dependencies]
# We recommend pinning to a specific version, because rapid iterations are expected as the library is in an active development phase.
stellar-fee-abstraction = "=0.6.0"
forward.forward; there is no executor allowlist.