Skip to main content

Overview

The Across Bridge Hooks enable automatic cross-chain token bridging when intents are fulfilled. They integrate with Across Protocol to bridge tokens from the source chain to a destination chain, enabling seamless cross-chain fiat on-ramps. Available Versions:
  • AcrossBridgeHook - V1 implementation (works with Orchestrator)
  • AcrossBridgeHookV2 - V2 implementation (works with OrchestratorV2)
Recommended Use Case: Stablecoin-to-stablecoin bridging only (e.g., USDC on Base → USDC on Arbitrum)

Key Features

Cross-Chain Compatibility

Supports both EVM and non-EVM chains:
  • EVM chains: Addresses are left-padded to bytes32
  • Non-EVM chains (Solana): Native 32-byte addresses used directly

Graceful Fallback

If bridging fails, funds are transferred to the recipient on the source chain instead of reverting. This ensures users always receive funds after making off-chain payments.

Two-Phase Data Model

Signal Time (Commitment):
  • Destination chain ID
  • Output token address
  • Recipient address
  • Minimum output amount
Fulfill Time (JIT Data):
  • Actual output amount
  • Fill deadline
  • Exclusive relayer (from Across API)
  • Exclusivity period

Important Limitations

Not Recommended for Volatile AssetsThe Across Bridge Hook is designed for stablecoin-to-stablecoin routes only. Using it with volatile assets (ETH, WBTC, etc.) can cause failures:
  1. minOutputAmount is committed at signal time
  2. Actual outputAmount is provided at fulfill time
  3. If asset price drops between signal and fulfill, the minimum check fails
  4. User has already made off-chain fiat payment and cannot recover funds if fulfill reverts
For stablecoins, price remains stable and checks reliably pass.

Architecture

Contract References

V1:
  • Location: contracts/hooks/AcrossBridgeHook.sol
  • Interface: IPostIntentHook
  • Orchestrator: Single orchestrator address set at deployment
V2:
  • Location: contracts/hooks/AcrossBridgeHookV2.sol
  • Interface: IPostIntentHookV2
  • Orchestrator: Uses IOrchestratorRegistry for multi-orchestrator support

Dependencies

Data Structures

BridgeCommitment

Stored in intent.data (V1) or intent.signalHookData (V2) at signal time:
Field Details:
  • destinationChainId: Chain ID where tokens will be received
    • Example: 42161 for Arbitrum, 8453 for Base
  • outputToken: Token address on destination chain
    • EVM: Use bytes32(uint256(uint160(tokenAddress))) to convert
    • Solana: Use native 32-byte public key
  • recipient: Where tokens will be sent on destination
    • EVM: Use bytes32(uint256(uint160(recipientAddress))) to convert
    • Solana: Use native 32-byte public key
  • minOutputAmount: Minimum tokens to receive
    • Set to ~99.5% of expected output for stablecoins
    • Protects against unfavorable price movement

AcrossFulfillData

Provided in _fulfillIntentData (V1) or _fulfillHookData (V2) at fulfill time:
Field Details:
  • intentHash: (V1 only) Intent identifier for event correlation
  • outputAmount: How many tokens recipient receives on destination
    • Must be ≥ minOutputAmount or hook falls back to local transfer
  • fillDeadlineOffset: Seconds from current block until fill expires
    • Typical range: 1800 (30 min) to 21600 (6 hours)
    • Longer for slower routes, shorter for fast routes
  • exclusiveRelayer: Relayer with priority access (from Across suggested-fees API)
    • Ensures faster fulfillment by known relayers
  • exclusivityParameter: How long exclusive relayer has priority (seconds)
    • Prevents fill competition during exclusivity window

Usage

Deployment

V1:
V2:

Signal Intent with Bridge Hook

V1 Example:
V2 Example:

Fulfill Intent with Bridge

Get Across API Data: Before fulfilling, query Across suggested-fees API:
V1 Fulfill:
V2 Fulfill:

Execution Flow

Fallback Behavior

The hook implements graceful degradation to protect users:

Fallback Triggers

  1. OUTPUT_BELOW_MINIMUM: outputAmount < minOutputAmount
    • Price moved unfavorably between signal and fulfill
    • Common with volatile assets (reason not to use hook for non-stablecoins)
  2. BRIDGE_CALL_FAILED: spokePool.depositNow() reverted
    • SpokePool paused
    • Route not supported
    • Across liquidity issues

Fallback Action

When fallback is triggered:
  1. Tokens are transferred to intent.to on the source chain
  2. FallbackTransfer event is emitted with reason code
  3. Transaction succeeds (does not revert)
Rationale: User has already made off-chain fiat payment. Reverting would lock their funds with no way to recover. Fallback ensures they receive tokens even if bridge fails.

Example Fallback Event

Events

AcrossBridgeInitiated

Emitted when bridge deposit successfully initiated:

FallbackTransfer

Emitted when bridge cannot be initiated:

Admin Functions

Both V1 and V2 include rescue functions for recovering stuck funds:

Rescue ERC20

Rescue Native

Security Considerations

Authorization

V1: Only the specific orchestrator set at deployment can call execute() V2: Any orchestrator registered in IOrchestratorRegistry can call execute()

Token Handling

  1. Exact Pulls: Hook pulls exact approved amount from orchestrator
  2. Approval Hygiene: Approvals to SpokePool are reset to 0 after operations
  3. No Stranded Funds: Tokens are either bridged or sent to recipient (never stuck)

Price Movement

For stablecoins, set minOutputAmount to ~99.5% of expected:
  • Allows minor bridge fee variation
  • Prevents DoS from tiny price movements
  • Still protects against significant slippage
For volatile assets, this model is unsafe:
  • Price can drop >0.5% in minutes
  • minOutputAmount check will fail
  • User loses access to funds after payment

Reentrancy

Orchestr ator calls hook within reentrancy guard. Hook does not need additional protection.

Cross-Chain Address Conversion

EVM Addresses to bytes32

Solana Addresses

Solana public keys are already 32 bytes:

Integration Checklist

  • Deploy hook with correct input token and spoke pool
  • Verify spoke pool supports your destination chain
  • Test bridge route with small amount first
  • Integrate Across suggested-fees API for relayer parameters
  • Set reasonable fillDeadlineOffset (1800-21600 seconds)
  • Set minOutputAmount to ~99.5% of expected output
  • Monitor FallbackTransfer events for failed bridges
  • Implement fallback notification for users
  • Test with both EVM and non-EVM destinations if needed