Skip to content

Terabethia - Testnet V2

How it works

Terabethia is based on L1 <> L2 messaging protocol from Starknet. We support same way of sending/consuming messages between Ethereum and IC. This V2 of the testnet extends Terabethia's security guarantees and utilizes Starknet to relay messages from the Internet Computer to Ethereum (from Ethereum to the Internet Computer that is not used or needed).

To use Terabethia:

  • You need to have a pair of contracts (Ethereum and IC) which will send/consume messages
  • Consuming message received from Ethereum is triggered automatically on IC
  • Consuming message received from IC requires user interaction; we only store proof from L2 -> L1, therefore user needs to initiate the call trying to consume the message

Is it decentralised?

Not yet. There's a plan for fully non-custodial setup which depends on ECDSA Threshold signatures.


The Testnet V2 Bridge - Contracts

Terabethia is currently deployed on Goerli Etherem network at address:

The IC canister is deployed on the IC's mainnet, and its canister ID is:


Getting Started - Available Methods

In terms of integrating and using Terabethia, the scope is simple. You have two main methods on each side of the bridge (Ethereum, and the Internet Computer) that contracts on each chain can call.

On Ethereum

There are two methods available. First, sendMessage used to send a message/payload through the bridge to a destination canister on the Internet Computer. Here the address is a Principal ID in hex format.

Terabethia.sendMessage(uint256 canisterId, uint256[] payload) {}

Secondly, consumeMessage used by Ethereum contracts to manually initiate the call needed to consume a message received from the Internet Computer.

Terabethia.consumeMessage(uint256 from_address, uint256[] calldata payload) {}

On the Internet Computer

On the IC, the methods are the same. First, sendMessage used to send a message/payload through the bridge to a destination canister on the Internet Computer. Here the destination (to) is an Ethereum contract address as a Principal.

TerabethiaCanister.send_message(to: Principal, payload: Vec<Nat>)

Secondly, consumeMessage used by Ethereum contracts to manually initiate the call needed to consume a message received from the Internet Computer. Here, the from is an Ethereum contract address in hex string format.

TerabethiaCanister.consume_message(from: Principal, payload: Vec<Nat>)

Example Implementations

You can view two quick contract example implementations on each corresponding chain on: