Skip to content

Near-One/omni-bridge

Repository files navigation

NEAR Omni Bridge

Build Status Release PRs Welcome Dev Support

The Omni Bridge is a multi-chain asset bridge that facilitates secure and efficient asset transfers between different blockchain networks. It leverages Chain Signatures and it's decentralized Multi-Party Computation (MPC) service to ensure trustless and decentralized cross-chain asset transfers.

For more information on how it works, please see Omni Bridge Documentation.

Supported Networks

  • Ethereum (Light client + Chain Signatures)
  • Bitcoin (Light client + Chain Signatures)
  • Solana (Currently Wormhole, transitioning to Chain Signatures)
  • Base (Currently Wormhole, transitioning to Chain Signatures)
  • Arbitrum (Currently Wormhole, transitioning to Chain Signatures)

Contract Addresses

Mainnet Addresses

Bridge Contracts:

Helper Contracts:

Testnet Addresses

Bridge Contracts:

Helper Contracts:

Development Testnet Addresses

Bridge Contracts:

Helper Contracts:

Transfer Times & Finality

Transfer Times Overview

NEAR → Other Chains

  • Average processing time: ~30 seconds (MPC signatures)

Other Chains → NEAR

Current finality times:

  • Solana: 14s
  • Arbitrum: 1066s
  • Base: 1026s
  • Ethereum: 960s

Additional processing delays:

  • OmniBridge transfers relayer: 2s
  • Wormhole off-chain validators: 60s
  • Ethereum blocks relayer: 60s

Token Operations

Logging Token Metadata

EVM API

function logMetadata(address tokenAddress) external

NEAR API

pub fn log_metadata(&self, token_id: &AccountId) -> Promise 

Solana API

pub fn log_metadata(ctx: Context<LogMetadata>) -> Result<()>

Using CLI

cargo run mainnet omni-connector log-metadata --token base:0x<TOKEN_ADDRESS> --base-private-key <KEY>

Using SDK-JS

import { getClient } from "omni-bridge-sdk";

// Initialize client for source chain
const client = getClient(ChainKind.Near, wallet);

// Example: Deploy NEAR token to Ethereum
const txHash = await client.logMetadata("near:token.near");
console.log(`Metadata logged with tx: ${txHash}`);
Deploying Tokens

EVM API

function deployToken(bytes calldata signatureData, BridgeTypes.MetadataPayload calldata metadata) payable external returns (address)

NEAR API

pub fn deploy_token(&mut self, #[serializer(borsh)] args: DeployTokenArgs) -> Promise

Solana API

pub fn deploy_token(ctx: Context<DeployToken>, data: SignedPayload<DeployTokenPayload>)

Using CLI

cargo run mainnet omni-connector deploy-token --chain <ChainKind> --source-chain <ChainKind> --tx-hash <LogMetadataTxHash> --base-private-key <KEY>
Binding Tokens (NEAR-specific)

Only needed for NEAR tokens that have been deployed on other chains. This action is typically applied automatically by the relayer.

NEAR API

pub fn bind_token(&mut self, #[serializer(borsh)] args: BindTokenArgs) -> Promise

Transfer Operations

Initiating Transfers

Transfers require a fee, which can be paid in either:

  1. The transferred token
  2. Native chain token (e.g., ETH, SOL)

Note: On NEAR, it isn't possible to attach a deposit in the ft_transfer_call, so the native fee should be attached by a separate call to the storage deposit

EVM API

// 1. Approve tokens
function approve(address spender, uint256 amount)

// 2. Initiate transfer
function initTransfer(
    address tokenAddress,
    uint128 amount,
    uint128 fee,
    uint128 nativeFee,
    string calldata recipient,
    string calldata message
) payable external

NEAR API

// 1. Storage deposit
pub fn storage_deposit(&mut self, account_id: Option<AccountId>) -> StorageBalance

// Helper functions
pub fn required_balance_for_account(&self) -> NearToken
pub fn required_balance_for_init_transfer(&self) -> NearToken

// 2. Transfer
fn ft_transfer_call(&mut self, receiver_id: AccountId, amount: U128, memo: Option<String>, msg: String) -> PromiseOrValue<U128>

Solana API

// For SPL tokens
pub fn init_transfer(ctx: Context<InitTransfer>, payload: InitTransferPayload) -> Result<()>

// For native SOL
pub fn init_transfer_sol(ctx: Context<InitTransferSol>, payload: InitTransferPayload) -> Result<()>

Fee Provider & Status API

API Details

API Endpoints:

  • Mainnet: https://mainnet.api.bridge.nearone.org/api/v1
  • Testnet: https://testnet.api.bridge.nearone.org/api/v1
  • OpenAPI Specification

Note: Custom relayers can process transfers with zero fees.

SDKs & Tools

Get Involved

We welcome contributions from the community! The code is open source and there are many ways to make meaningful contributions.

Key Areas for Contribution

  • Chain Integrations: Help expand support for new blockchain networks
  • Performance Optimization: Improve transaction speeds and efficiency
  • Security Analysis: Strengthen the security infrastructure
  • Developer Tools: Build better tooling and documentation

Bridge infrastructure is a fundamental component of a multi-chain future. Through Chain Signatures, we're creating a more efficient, secure, and scalable approach to cross-chain communication.

Join us in building the future of cross-chain interoperability!