LayerZero
BOB Gateway's LayerZero integration enables seamless cross-chain swaps between Bitcoin and LayerZero-supported chains. All transactions route through BOB as an intermediary, leveraging LayerZero's Omnichain Fungible Token (OFT) protocol for secure cross-chain bridging.
High-Level Developer Overviewโ
How It Worksโ
The LayerZero Gateway Client routes all cross-chain transactions through BOB, acting as the hub for LayerZero connectivity:
Bitcoin โ LayerZero Chain Flowโ
- Bitcoin โ BOB: User sends Bitcoin, receives wBTC on BOB via Gateway
- BOB โ Target Chain: wBTC is bridged via LayerZero OFT to destination chain
- Strategy Execution: BOB strategy contract handles the LayerZero bridging automatically
LayerZero Chain โ Bitcoin Flowโ
- Origin Chain โ BOB: User's tokens are bridged to BOB via LayerZero
- BOB Processing: Offramp composer creates Bitcoin withdrawal order
- BOB โ Bitcoin: Standard Gateway offramp process completes the swap
Supported Chainsโ
The LayerZero integration supports 15+ major EVM chains including Ethereum, Base, Arbitrum, Avalanche, BSC, and more.
Get Quoteโ
Get a quote for cross-chain swaps via LayerZero:
import { LayerZeroGatewayClient, parseBtc } from '@gobob/bob-sdk';
import { bob } from 'viem/chains';
const client = new LayerZeroGatewayClient(bob.id);
// Bitcoin โ Base example
const onrampQuote = await client.getQuote({
fromChain: 'bitcoin',
fromToken: 'BTC',
toChain: 'base',
toToken: '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c', // wBTC
fromUserAddress: 'bc1q...', // Bitcoin address
toUserAddress: '0x...', // EVM address on destination chain
amount: parseBtc("0.1"), // BTC
l0FeeBuffer: 500 // 5% LayerZero fee buffer (optional)
});
// Base โ Bitcoin example
const offrampQuote = await client.getQuote({
fromChain: 'base',
fromToken: '0x0555E30da8f98308EdB960aa94C0Db47230d2b9c', // wBTC
toChain: 'bitcoin',
toToken: 'BTC',
fromUserAddress: '0x...', // EVM address on origin chain
toUserAddress: 'bc1q...', // Bitcoin address
amount: 17000 // token amount in smallest unit
});