Skip to main content

Bridge Service

With the bridge service a user or an application can initiate token transfers through the bridge or more generally cross shard calls. Let's take a look at the most frequently used scenario of transferring fungible tokens from one chain to another. Users want to transfer NEAR from the mainnet to a Calimero shard. First a lock method is called on a contract on NEAR mainnet. Once the transaction ends on the blockchain, the bridge service makes an RPC call to an archival node on NEAR mainnet to get the proof of this transaction. A mint method on a contract on Calimero shard can now be called, supplied with the proof that NEAR tokens are indeed locked on mainnet. Prover contract on Calimero can check the proof by comparing expected block merkle root from the light client contract that was supplied with valid block headers from NEAR mainnet. If this hash matches, wrapped NEAR can be minted on Calimero shard.