Back to Developers

Cross-Chain Guide

Deploy and manage vaults across 8+ blockchains with unified state synchronization and seamless asset management.

Supported Chains

BNB Chain

Chain ID: 56

Live

opBNB

Chain ID: 204

Live

Ethereum

Chain ID: 1

Live

Polygon

Chain ID: 137

Live

Arbitrum

Chain ID: 42161

Live

Optimism

Chain ID: 10

Live

Base

Chain ID: 8453

Live

Avalanche

Chain ID: 43114

Live

How Cross-Chain Works

1. Primary Deployment

Create your vault on any supported chain. This becomes your primary chain where the vault contract is deployed.

2. Cross-Chain Extension

Extend your vault to additional chains. Assets on each chain are managed independently but share the same release conditions.

3. Unified State

Attestations and check-ins on any chain are synchronized across all deployments using our cross-chain messaging layer.

SDK Integration

Deploy Vault to Additional Chain

import { AfterCryptProtocol } from '@aftercrypt/sdk';

const sdk = new AfterCryptProtocol({
  chain: 'bsc',
  mode: 'mainnet'
});

// Deploy existing vault to Polygon
await sdk.crossChain.deployToChain(vaultId, 137);

// Deploy to multiple chains
await sdk.crossChain.deployToChains(vaultId, [1, 137, 42161]);

Synchronize Vault State

// Sync state across all chains
await sdk.crossChain.sync(vaultId);

// Get vault deployments
const deployments = await sdk.crossChain.getCrossChainVaults(vaultId);
console.log(deployments);
// [
//   { chainId: 56, address: '0x...', status: 'active' },
//   { chainId: 137, address: '0x...', status: 'active' },
//   { chainId: 42161, address: '0x...', status: 'syncing' }
// ]

Monitor Cross-Chain Events

// Listen for cross-chain sync events
sdk.events.onCrossChainSync(vaultId, (event) => {
  console.log(`Synced to chain ${event.chainId}`);
  console.log(`New state: ${event.state}`);
});

// Listen for cross-chain releases
sdk.events.onCrossChainRelease(vaultId, (event) => {
  console.log(`Released on chain ${event.chainId}`);
  console.log(`Amount: ${event.amount}`);
});

Best Practices

Gas Optimization

Batch cross-chain deployments during low gas periods. Use our gas estimator to find optimal deployment windows.

Primary Chain Selection

Choose a primary chain with low fees and fast finality for the best check-in experience. BNB Chain or Polygon are recommended.

Sync Frequency

State is automatically synced after attestations and check-ins. Manual sync is only needed for immediate consistency.

Asset Distribution

Distribute assets across chains based on beneficiary preferences. Consider gas costs for release transactions.

Ready to Go Cross-Chain?

Start deploying vaults across multiple blockchains today.