Skip to Content

Fee Authorization

Fee authorization applies when staking BTC to Ethereum Mainnet or Sepolia. The SDK requests an EIP-712 signature to authorize the network fee via the authorize() step.


EVM Destinations (Ethereum Mainnet)

For Ethereum-based destinations, the workflow moves through:

IDLE → NEEDS_FEE_AUTHORIZATION → READY → ADDRESS_READY

The prepare() method initiates this sequence, followed by authorize() to obtain the necessary signature.


Signature Reusability

Previously stored fee signatures can be reused. When calling prepare() again, if a valid signature exists from a previous operation, prepare() will skip directly to READY. This eliminates redundant user prompts.


Non-EVM Destinations

Non-EVM destinations (Base, Solana, Sui, etc.) follow a different pattern using address confirmation rather than fee authorization:

IDLE → NEEDS_ADDRESS_CONFIRMATION → READY → ADDRESS_READY

This involves signing a message confirming the destination chain identifier instead of authorizing network fees.


Implementation

Check the returned status after prepare() to determine whether fee authorization is necessary:

const stake = sdk.chain.btc.stake({ destChain: Chain.ETHEREUM, assetOut: AssetId.LBTC, }); await stake.prepare({ amount: '0.1', recipient: '0x1234...', }); // Check if authorization is needed if (stake.status === BtcActionStatus.NEEDS_FEE_AUTHORIZATION) { await stake.authorize(); } // Now ready to generate deposit address const address = await stake.generateDepositAddress();
Last updated on