Cross-Layer Transfer

Unit Zero Layer-1 (L1) network operates atop Waves Layer-0 (L0) network, facilitating token transfer between the L1 and L0 networks, ensuring consensus, and offering economic incentives.

The supported token types for transfer:

Native Token Transfer

The supported token transfer directions:

L1 to L0 Transfer

The native token of the L1 network can be transferred to the L0 network by converting it into a wrapped token.

The process of token transfer from L1 to L0:

  1. A L1 transaction sender invokes the Bridge Contract to:

    1. Lock UNIT0 permanently.

    2. Emit an operation event.

    NOTE: The L1 Consensus Client listens for the emitted events.

  2. The block miner invokes the L0 Chain Contract to:

    1. Post the block metada.

    2. Apply a cryptographic digest of the L1-to-L0 transfer.

  3. The L0 transaction recipient must wait until the block reaches irreversibility: ~200 L1 epochs.

    NOTE:

    • Each L0 block corresponds to a L1 epoch.

    • This step guarantees transaction finality, safeguarding against double spending and token loss during potential L1 reorganizations.

  4. The L0 transaction recipient:

    1. Invokes the Chain Contract.

    2. Applies the cryptographic proof of the transfer.

  5. The L0 Chain Contract:

    1. Mints the wrapped UNIT0 token.

    2. Sends the token to the L0 transaction recipient.

L0 to L1 transfer

NOTE: The reverse transfer is streamlined and nearly instant.

  1. A L0 sender invokes the Chain Contract with the wrapped UNIT0 token used.

  2. The Chain Contract:

    1. Burns the wrapped token.

    2. Adds a record in its state.

  3. The L1 miner:

    1. Reads the state.

    2. Adds UNIT0 withdrawal transaction data to the block.

      NOTE: When posting the block metadata in L0, the miner marks the transfer as processed.

  4. The UNIT0 token becomes available to the L1 transaction recipient in the next block.

Custom Token Transfer

Custom, non-native token transfers follow the same process:

The Chain Contract establishes a link between tokens in L1 and their counterparts in L0:

  • For tokens created in L1, the Chain Contract mints their wrapped version in L0.

  • For tokens created in L0, their smart contract in L1 must emit the relevant events to enable their return to L0.

Last updated