Cross-Chain Bridge
JuChain’s cross-chain bridge is a decentralized service that allows developers to transfer assets between different testnets, such as the JuChain Testnet, BSC Testnet (Chapel), and ETH Testnet (Holesky). It operates through on-chain smart contracts (primarily the BridgeBank contract) and off-chain components (Relayers and Signers) that work together to manage locking, unlocking, minting, and burning operations, ensuring the security and efficiency of cross-chain asset transfers.
Architecture Overview
JuChain’s cross-chain bridge adopts a typical "lock/burn & mint/unlock" model, combined with an off-chain validation mechanism. Below are the core components and their interactions:
BridgeBank Contract: The core smart contract deployed on each supported chain (JuChain, BSC, ETH).
On the Source Chain: Responsible for receiving and locking (
lock) users’ original assets or burning (burnBridgeTokens) assets bridged back, and triggering corresponding events (LogLock,LogBtcTokenBurn).On the Target Chain: Responsible for minting (
mintBridgeTokens) bridged assets or unlocking (unlock) returned original assets based on validated information.
Relayers: Off-chain services that monitor events from the
BridgeBankcontracts on each chain.Monitoring: Continuously listen for
LogLockevents on the source chain (for ETH/BSC -> JuChain) orLogBtcTokenBurnevents on JuChain (for JuChain -> ETH/BSC).Submission: Upon detecting relevant events, collect event data and submit it to Signers for validation.
Execution: After receiving valid signatures/authorizations from Signers, call the appropriate methods (
mintBridgeTokensorunlock) on the target chain’sBridgeBankcontract to complete the cross-chain operation. The diagram shows multiple Relayers (Relayer_0, Relayer_1, Relayer_2), suggesting redundancy or parallel processing mechanisms.
Signers (Validators): Off-chain services responsible for verifying the authenticity and validity of cross-chain events.
Validation: Receive event data from Relayers and independently verify whether the event genuinely occurred and is valid on the source chain.
Authorization: Upon successful validation, generate signatures or other forms of authorization, allowing Relayers to execute operations on the target chain. The diagram includes
signer0andsigner1(possibly multiplesigner1instances or representing a multi-signature group), indicating that the validation process may involve multiple parties or vary by chain/process. The index information atsigner0(Index: 0:for juchain, 1:eth, 2:bsc) suggests that validation nodes internally distinguish between different chains.
Users: The end-users initiating cross-chain transfers, interacting with the source chain’s
BridgeBankcontract to start the process.Admin: A role potentially responsible for providing initial liquidity, maintaining contracts, or performing other administrative tasks (e.g., depositing 20 into BSC as shown in the diagram).
This architecture ensures the security of cross-chain operations, as actions on the target chain (minting/unlocking) require confirmation from off-chain validators.
Contract Addresses and Token Information
Below are the detailed addresses of the cross-chain bridge-related contracts and tokens across different networks. Developers must ensure they use the correct network:
--- Mainnet ---
JuChain Mainnet
BridgeBank
Core cross-chain contract on JuChain Mainnet
JuChain Mainnet
USDT (post-bridge)
Bridged USDT token on JuChain Mainnet
JuChain Mainnet
BNB (post-bridge)
Bridged BNB token on JuChain Mainnet
JuChain Mainnet
ETH (post-bridge)
---
(Not available)
ETH Mainnet
Signer Address
0xc739962C7805a46BEd5bDADB4Df033e9B9aC1ff2
Used to validate ETH -> JuChain transactions
BSC Mainnet
Signer Address
0xc3F59038F2fceDec5f41f46aBb130ca4446556E1
Used to validate BSC -> JuChain transactions
JuChain Mainnet
Signer Address
0xA62b1782af4AfFd74CEcFC5E0BA96E1b31eb371C
Used to validate JuChain -> ETH/BSC transactions
--- Testnet ---
JuChain Testnet
BridgeBank
Core cross-chain contract on JuChain Testnet
JuChain Testnet
USDT (post-bridge)
Bridged USDT token on JuChain Testnet
JuChain Testnet
tBNB (post-bridge)
Bridged tBNB token on JuChain Testnet
JuChain Testnet
tETH (post-bridge)
Bridged tETH token on JuChain Testnet
BSC Testnet (Chapel)
BridgeBank
Core cross-chain contract on BSC Testnet
BSC Testnet (Chapel)
USDT (pre-bridge)
USDT contract on BSC Testnet
ETH Testnet (Holesky)
BridgeBank
Core cross-chain contract on ETH Holesky Testnet
ETH Testnet (Holesky)
USDT (pre-bridge)
USDT contract on ETH Holesky Testnet
BridgeBank Contract Functions
The BridgeBank contract is the core of the cross-chain bridge, providing the following key functions that developers can interact with via ABI:
lock(ETH/BSC -> JuChain): Locks tokens on the source chain (ETH/BSC) and initiates a cross-chain transfer. This triggers theLogLockevent, monitored by Relayers.Parameters:
_recipient(recipient address on JuChain),_token(source chain token address),_amount(transfer amount).
burnBridgeTokens(JuChain -> ETH/BSC): Burns bridged tokens on JuChain and initiates a return transfer to the source chain. This triggers theLogBtcTokenBurnevent, monitored by Relayers.Parameters:
_chainID(target chain ID),_receiver(recipient address on the source chain),_bridgeTokenAddress(bridged token address on JuChain),_amount(amount).
unlock(JuChain -> ETH/BSC completion): Unlocks original tokens on the target chain (ETH/BSC). Called by a Relayer after receiving Signer authorization.Parameters:
_recipient(recipient address),_token(token address),_name(token name),_amount(amount). (ETH/BSC ABI also includes_claimID).
mintBridgeTokens(ETH/BSC -> JuChain completion): Mints bridged tokens on the target chain (JuChain). Called by a Relayer after receiving Signer authorization.Parameters:
_intendedRecipient(recipient address),_bridgeTokenAddress(bridged token address),_amount(amount).
ABI Data
Below is the ABI for the BridgeBank contracts used on the testnets, which developers can use to interact with the contracts:
JuChain BridgeBank ABI
ETH/BSC BridgeBank ABI
Cross-Chain Process
JuChain’s cross-chain bridge supports the following workflows:
From JuChain to BSC/ETH
Burn Assets (User Action - JuChain):
On the JuChain Testnet, the user calls the
burnBridgeTokensfunction of theBridgeBankcontract.Parameters include: target chain ID (97 for BSC Chapel, 17000 for ETH Holesky), recipient address (on the target chain), token address (bridged token on JuChain), and amount.
The function burns the bridged tokens on JuChain and triggers the
LogBtcTokenBurnevent.
Cross-Chain Validation (Off-Chain - Relayer & Signer):
Relayers monitor and detect the
LogBtcTokenBurnevent on JuChain.Relayers submit the event data to Signers.
Signers verify the validity of the burn event (confirming the transaction was successfully executed on JuChain) and generate authorization (e.g., a signature).
Target Chain Unlock (Off-Chain Driven, On-Chain Execution - BSC/ETH):
After receiving authorization, the Relayer calls the
unlockfunction on the target chain’s (BSC or ETH)BridgeBankcontract, attaching the authorization data.The target chain’s
BridgeBankcontract verifies the authorization and unlocks/transfers the equivalent amount of original tokens to the user-specified recipient address.
From BSC/ETH to JuChain
Lock Assets (User Action - BSC/ETH):
On the BSC or ETH Testnet, the user calls the
lockfunction of theBridgeBankcontract.Parameters include: recipient address (on JuChain), token address (original token on the source chain), and amount.
The function locks the user’s tokens and triggers the
LogLockevent.
Cross-Chain Validation (Off-Chain - Relayer & Signer):
Relayers monitor and detect the
LogLockevent on the source chain.Relayers submit the event data to Signers.
Signers verify the validity of the lock event (confirming the transaction was successfully executed on the source chain) and generate authorization.
JuChain Minting (Off-Chain Driven, On-Chain Execution - JuChain):
After receiving authorization, the Relayer calls the
mintBridgeTokensfunction on the JuChain Testnet’sBridgeBankcontract, attaching the authorization data.The JuChain
BridgeBankcontract verifies the authorization and mints the equivalent amount of bridged tokens to the user-specified recipient address.
Code Examples
Below are code examples using Web3.js to interact with the cross-chain bridge:
Cross-Chain Transfer from JuChain to BSC
Cross-Chain Transfer from BSC to JuChain
Notes
Testnet Limitations:
These contracts and tokens are only available on testnets and are not suitable for mainnet environments.
Testnets may be reset periodically; do not store valuable assets on them.
Service Fees:
Cross-chain operations require a service fee, which can be queried via the
bridgeServiceFeefunction.Fees are paid in the source chain’s native token (JU, tBNB, or Holesky ETH) and sent as the
valuewhen initiatinglockorburnBridgeTokenstransactions.
Approval Requirements:
Before calling the
lockfunction to lock ERC20 tokens, users must first call the token contract’sapprovefunction to authorize theBridgeBankcontract to use the required amount.burnBridgeTokenstypically does not requireapprove, as it directly operates on the bridged tokens in the user’s account.
Cross-Chain Delay:
Cross-chain operations are not instantaneous, as they depend on Relayers detecting events, Signers validating them, and Relayers executing actions on the target chain.
Delays depend on network congestion and the processing speed of off-chain components. Be patient and check transaction statuses on block explorers for both source and target chains.
Token Compatibility:
Only whitelisted tokens can be bridged.
Currently supported tokens include USDT, tBNB, and tETH (in bridged form on JuChain or original form on ETH/BSC).
Error Handling:
If a cross-chain operation fails, check:
Whether parameters are correct (recipient address, token address, amount, target chain ID).
Whether the source chain transaction succeeded (insufficient Gas, insufficient approval, etc.).
Whether there’s enough token balance and service fee (native token balance).
Review console output for error messages and transaction receipts.
Off-Chain Component Dependency:
The bridge’s proper functioning relies on off-chain Relayers and Signers. While these components are typically designed to be decentralized and resilient (e.g., through multiple nodes, multi-signature, or consensus mechanisms), their availability, correctness, and processing speed are critical to the timely completion of cross-chain transfers.
Cross-Chain Fees
Cross-chain operations require a service fee to cover the Gas costs on the target chain and platform operational costs. The fee is paid in the source chain’s native token when initiating a lock (ETH/BSC to JuChain) or burnBridgeTokens (JuChain to ETH/BSC) transaction.
Fee Structure:
Fees typically consist of two parts:
Network Gas Fee: Covers the transaction execution cost on the target chain (e.g., unlocking or minting). This varies based on the target chain’s real-time Gas price.
Platform Service Fee: Charged by the JuChain platform to maintain the bridge service.
Mainnet Fee Reference (subject to change based on network conditions and token prices):
BSC > JU
USDT
Charges 0.0002 BNB (network fee) + 0.0002 JU (platform fee) (Estimated value: network ≈ 0.1 USD, platform ≈ 0.0004 USD)
BSC > JU
BNB
Charges 0.0002 BNB (network fee) + 0.0002 JU (platform fee) (Estimated value: network ≈ 0.1 USD, platform ≈ 0.0004 USD)
ETH > JU
USDT
Charges 0.00005 ETH (network fee) + 0.0002 JU (platform fee) (Estimated value: network ≈ 0.1 USD, platform ≈ 0.0004 USD)
ETH > JU
ETH
Charges 0.00005 ETH (network fee) + 0.0002 JU (platform fee) (Estimated value: network ≈ 0.1 USD, platform ≈ 0.0004 USD)
JU > BSC
USDT
Charges 1 JU (platform fee) + 0.002 BNB (estimated network fee) (Estimated total ≈ 1 USD)
JU > BSC
BNB
Charges 1 JU (platform fee) + 0.002 BNB (estimated network fee) (Estimated total ≈ 1 USD)
JU > ETH
USDT
Charges 1 JU (platform fee) + 0.00002 ETH (estimated network fee) (Estimated total ≈ 0.036 USD)
JU > ETH
ETH
Charges 1 JU (platform fee) + 0.00002 ETH (estimated network fee) (Estimated total ≈ 0.036 USD)
Note: The above value estimates are based on prices at a specific time (e.g., BNB=590 USD, ETH=1800 USD, JU=2 USD). Actual fees and values will fluctuate. The platform consumption portion refers to the cost incurred by the platform to process the transaction.
Fee Receiver Address:
0x8C0641240B418e0349dC52abd3F5cEcc4D4C748A
Recommendation: Before performing a cross-chain operation, you can query the current estimated service fee (typically only the platform fee, excluding target chain Gas) by calling the bridgeServiceFee() method on the source chain’s BridgeBank contract. The total fee paid should be estimated by the user based on current network conditions and target chain Gas prices.
Last updated