Technical

1. Architecture Overview

The USDT0 implementation separates token functionality from cross-chain messaging. This split enables independent upgrades of token and messaging components while maintaining consistent token behavior across chains.

Core Components

The implementation consists of three main components:

  1. OAdapterUpgradeable (on Ethereum):

    1. Implements LayerZero OFT functionality for Ethereum

    2. Handles both sending and receiving cross-chain messages

    3. Interfaces directly with the TetherToken contract on Ethereum

    4. Locks/Unlocks USDT for cross-chain transfers

  2. OUpgradeable (on other chains):

    1. Implements LayerZero OFT functionality for other chains

    2. Handles both sending and receiving cross-chain messages

    3. Interfaces with the TetherTokenOFTExtensoin

    4. Controls minting/burning for cross-chain transfers

  3. TetherTokenOFTExtension (on other chains):

    1. Offers mint/burn interface for the OFT

Component Interaction Diagram

The graphic illustrates how USDT and USDT0 are transferred across Ethereum, Chain A, and Chain B:

  1. Ethereum Chain B:

    • USDT Adapter locks USDT on Ethereum.

    • A LayerZero message triggers USDT0 OFT on Chain B to mint equivalent USDT0.

  2. Chain B Chain A:

    • USDT0 OFT burns USDT0 on Chain B.

    • A message triggers USDT0 OFT on Chain A to mint the equivalent.

  3. Chain A Ethereum:

    • USDT0 OFT burns USDT0 on Chain A.

    • A message instructs the USDT Adapter to unlock USDT on Ethereum.

The flow ensures consistent token supply across chains.

2. Interfaces Reference

Token Interfaces

The USDT0 token implements the following standard interfaces:

  • ERC20

  • ERC20Permit (EIP-2612)

  • EIP-3009 (Gasless transfers)

Key public functions for integration:

interface IERC20 {
    function transfer(address to, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
    function approve(address spender, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function totalSupply() external view returns (uint256);
}

interface IERC20Permit {
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

// EIP-3009 functions for gasless transfers
interface IEIP3009 {
    function transferWithAuthorization(
        address from,
        address to,
        uint256 value,
        uint256 validAfter,
        uint256 validBefore,
        bytes32 nonce,
        bytes memory signature
    ) external;
    
    function receiveWithAuthorization(
        address from,
        address to,
        uint256 value,
        uint256 validAfter,
        uint256 validBefore,
        bytes32 nonce,
        bytes memory signature
    ) external;
}

OFT Interfaces

The OFT implementation provides cross-chain transfer functionality through LayerZero:

interface IOFT {
    // Quote the fee for a cross-chain transfer
    function quoteOFT(SendParam calldata sendParam) external view returns (
        OFTLimit memory oftLimit,
        OFTFeeDetail[] memory oftFeeDetails,
        OFTReceipt memory oftReceipt
    );
    
    // Execute a cross-chain transfer
    function send(
        SendParam calldata sendParam,
        MessagingFee calldata fee,
        address refundAddress
    ) external payable returns (MessagingReceipt memory, OFTReceipt memory);
}

struct SendParam {
    uint32 dstEid;          // Destination endpoint ID
    bytes32 to;             // Recipient address
    uint256 amountLD;       // Amount in local decimals
    uint256 minAmountLD;    // Minimum amount to receive (slippage protection)
    bytes extraOptions;     // Additional options for the transfer
    bytes composeMsg;       // Optional composed message
}

struct MessagingFee {
    uint256 nativeFee;      // Fee in native gas token
    uint256 lzTokenFee;     // Fee in LZ token
}

The OFT interface is consistent across all chains, whether using OAdapterUpgradeable on Ethereum or OUpgradeable on other chains. The only difference is that on Ethereum, users need to approve the OFT adapter to spend their USDT before calling send.

3. Deployments

Ethereum Mainnet

INK Chain

4. Security Configuration (DVNs)

USDT0 utilizes a dual-DVN security configuration requiring verification from:

  • LayerZero DVN

  • USDT0 DVN

Both DVNs must verify the payloadHash before a cross-chain message can be committed for execution. This setup ensures enhanced security through independent verification of all cross-chain transfers.

For detailed information about LayerZero DVNs and security stacks, refer to: https://docs.layerzero.network/v2/home/modular-security/security-stack-dvns

Last updated