Skip to main content
Trails is designed with user sovereignty at its core. While the protocol includes automatic refund mechanisms for failed transactions, users always retain full control over their funds and can initiate manual recovery at any time.

Automatic Refunds

Trails has an automatic refund mechanism built in to protect your assets in the event of a transaction failure. The protocol handles refunds automatically without requiring user intervention:
For more details on how refunds work within the Trails architecture, see the How Trails Works documentation.

User Control & Ownership

Trails is non-custodial by design. Only the user always retains control over their account and funds:
  • Intent-Scoped Authorization: Intent addresses only authorize the specific transaction calldata the user has explicitly permitted—nothing more
  • User Control: Users can take direct action over their funds at any time, even in emergencies
  • Non-Custodial: Trails never takes custody; execution happens via the user’s wallet permissions, preserving full control and auditability
The user’s wallet is the only party with control over the intent address. This cryptographic guarantee ensures the funds are always recoverable.

Initiating a Refund

There are two ways to initiate a refund for a pending or stuck intent:
  • Via the Explorer — Go to the Trails Explorer, connect the wallet you used to initiate the transaction, and navigate to the pending intent. From there, you can initiate a manual refund directly.
  • Via the Widget — If you’re using an application with the Trails Widget embedded, head to the History section. The widget will automatically detect intents that are eligible for a refund and allow you to initiate one in-place.

Manual Fund Recovery with useIntentRecover

While Trails automatically refunds upon transaction failures, there may be edge cases where funds are stuck without an explicit revert. The useIntentRecover hook provides utilities to manually sign and execute recovery transactions to recover funds from intent addresses if you’d like to add to your own app.

Basic Usage

This example uses wagmi hooks (useWalletClient, useAccount). Since 0xtrails@0.16.0, wagmi is opt-in — install @0xtrails/adapter-wagmi and pass wagmiAdapter({ wagmiConfig }) in adapters for these hooks to resolve. See SDK Hooks.

When to Use Manual Refunds

Automatic Refunds

Most common scenario — Trails automatically handles refunds when transactions explicitly fail or revert. No user action required.

Manual Recovery

Edge cases only — Use useIntentRecover when funds are stuck without an explicit revert, or when you want to proactively recover funds from a pending intent.

Security Guarantees

The refund mechanism maintains Trails’ security principles:
  • Only the original sender can authorize refunds via wallet signature
  • Cryptographic verification ensures refund transactions are valid
  • Non-custodial — Trails cannot access or move your funds without your signature
  • Onchain execution — All refund operations are verifiable onchain
For more information, see: