LogoLogo
  • Entangle
    • Overview
    • Security Audits
  • Universal Interoperability Protocol
    • Overview
    • Architecture
      • Scalability and Network Stability
        • L2 Utility Blockchains
        • Transmitter Groups
      • Security and Consensus Mechanism
      • Finality
      • Execution Latency
      • Compatibility and Interoperability
    • Developer Guides
      • Getting Started
      • Solidity
        • Simple Abstract Messenger Example
        • Deploying Your Custom EVM Protocol
        • Bridging Tokens with UIP
        • Become an EVM Transmitter
      • Solana
        • Simple Abstract Messenger Example
        • Deploying Your Custom Solana Protocol
        • Become a Solana Transmitter
      • Calculate Cross-Chain Transaction Cost
      • Customizable Message Transmission Options
      • How to Debug Sent Messages
      • SDK Setup
      • Revenue Sharing for Transmitters
      • How to Become a Super Transmitter
    • Endpoints
  • Universal Data Feeds
    • Overview
    • Architecture
      • Data Delivery Methods
        • Pull Model
        • Push Model
      • Oracle Contract & User Interaction
    • Developer Guides
      • Custom Data Feeds
      • Fetch Data via Pull Model (PAYG)
        • EVM Smart Contracts
        • Solana Smart Contracts
      • Fetch Data via Pull Model (Subscriptions)
        • EVM Smart Contracts
        • Solana Smart Contracts
      • Fetch Data via Push Model
        • EVM Smart Contracts
        • Solana Smart Contracts
    • User Guides
      • Accessing Feeds
      • Subscribe to a Data Feed
      • Check Subscription
      • Manage Subscription
      • Renew Subscription
    • Data Endpoints
  • Universal Token Standard
    • Overview
    • Architecture
      • Fee Components
    • Developer Guides
      • Manual Deploy
        • Token Deployment Types
        • Create a Custom Token
        • Factory Blueprint Deployment
        • Examples
          • Initial Setup
          • UTS Connector
            • Mint & Burn Connector Scheme
            • Lock & Unlock Connector Scheme
            • Connector Over Native Currency
          • UTS Token
            • Simple Token
            • Token with Messages
      • Bridge SDK
      • Token Verification
      • Fees Calculation & Gas Estimation Logic
      • Estimations
    • User Guides
      • Launch Universal Token
      • Create a Liquidity Pool
      • Expand Existing Token
      • Transfer Liquidity to Connector
      • Bridging
    • Contract Addresses
  • Entangle Interoperable Blockchain
    • Overview
    • Architecture
    • Developer Guides
      • Set up a Validator Node
      • Delegating to Validators
      • Undelegating from Validators
      • Supported Accounts
  • More
    • Media Kit
    • FAQ
    • Report an Issue
    • Become a Partner
Powered by GitBook
On this page
  • Propose Function
  • Parameter Definitions
  • Encoded Parameter Option Definitions
  • Encoding Parameters
  • Block Finalization
  • Block Finalization Option Descriptions
  • Block Finalization Option Behaviour Explanations
  • Block Finalization Option Use Cases
  • Recommended Values for Block Finalization

Was this helpful?

Export as PDF
  1. Universal Interoperability Protocol
  2. Developer Guides

Customizable Message Transmission Options

UIP allows users to tailor message transmission settings to meet specific application requirements, balancing priorities like speed and security. These options are encoded and stored in the encoded parameter option, enabling agents to execute transactions in line with user-defined preferences.

Propose Function

This function emits an event from the smart contract, which is picked up by our agents. The agents decode the event to extract details such as the destination chain, the message content, the block finalization option, any custom gas limits, and other relevant information. Once decoded, the message is transmitted to our EIB chain for further processing.

function propose(
    uint256 destChainID,
    bytes32 selectorSlot,
    bytes calldata encodedParams,
    bytes calldata destAddress,
    bytes calldata payload
) external payable {
    _propose(
        _msgSender(), 
        destChainID, 
        selectorSlot, 
        agentParams, 
        destAddress, 
        payload
    );
}
Solidity Example Code
function sendMessage(
        uint256 chainID,
        uint256 blockFinalizationOption,
        uint256 customGasLimit,
        bytes calldata destAddress,
        string calldata _msg
    ) external payable {
        TransmitterParamsLib.TransmitterParams memory transmitterParams = TransmitterParamsLib.TransmitterParams(
            blockFinalizationOption,
            customGasLimit
        );
        bytes memory encodedParams = abi.encodePacked(transmitterParams.blockFinalizationOption, transmitterParams.customGasLimit);
        
        IEndpoint(endpoint).propose{value: msg.value}(
            chainID,
            SelectorLib.encodeDefaultSelector(
                DEFAULT_SELECTOR
            ),
            encodedParams,
            destAddress,
            abi.encode(abi.encode(_msg), abi.encode(_msgSender()))
        );
    }
Solana Example Code

Parameter Definitions

Parameter
Description

destChainID

The identifier of the destination chain.

selectorSlot

A default selector for the execute function in the endpoint contract (this value should remain unchanged).

encodedParams

Encoded parameters such as blockFinalizationOption and customGasLimit inbyte format (details on creating these parameters are provided below).

destAddress

The address of the recipient on the destination chain.

payload

The payload is any data which should be carried to the destination chain. Use abi.encode(...) to convert your data into "bytes" format.

Encoded Parameter Option Definitions

The transmission options are stored in a struct called the TransmitterParams. For up-to-date parameter definitions please refer to the latest implementation of the TransmitterParamsLib.

struct TransmitterParams {
    uint256 blockFinalizationOption;
    uint256 customGasLimit;
}

The transmission options descriped below are then encoded into bytes and stored in the encodedParams parameter of the propse function.

Option
Description

blockFinalizationOption

Defines the number of blocks to wait before retrieving message events from the source chain and execution events from the destination chain.

customGasLimit

Specifies the gaslimit for transaction execution on destination chain.

Encoding Parameters

To encode these parameters into bytes, use the abi.encodePacked() function and pass in the TransmitterParams options one by one, as shown in the example below.

bytes memory encodedParams = abi.encodePacked(transmitterParams.blockFinalizationOption, transmitterParams.customGasLimit);

Block Finalization

UIP gives full control to developers. One such way is via the block finalization option which allows you to fine tune the block wait time. By default the standard type is recommended and used. However, if you wish to use another option, we provide extra details and use cases for each finalization type.

Block Finalization Option Descriptions

Warning: Use the "Unsafe" option with EXTREME CAUTION. By selecting it, you explicitly acknowledge and accept the risk that the transaction or event might be reverted due to a block reorg. This could lead to data inconsistency or financial loss.

Finalization Type
Description

Standard

The default and safest option. It adheres to the full finalization process defined by the source network. This ensures the highest or close to the highest level of security and immutability.

Fast

Prioritizes speed while maintaining a reasonable level of safety. It uses a reduced finalization process that is less strict than Standard Finalization but still guarantees secure delivery.

Unsafe

The fastest option, but it bypasses standard finalization processes. This dramatically reduces confirmation time but introduces the risk of block restructuring (reorgs).

Block Finalization Option Behaviour Explanations

Finalization Type
Behaviour

Standard

Confirmation occurs only after the standard block finalization period (or block depth) specified by the source network has elapsed.

Fast

Confirmation occurs after a minimal finalization process, ensuring the block sequence is unlikely to be reverted.

Unsafe

Confirmation is immediate or near-immediate, based on minimal criteria. There's no guarantee that the confirmed transaction will be permanent.

Block Finalization Option Use Cases

Finalization Type
Use Case

Standard

Recommended for applications handling high-value transactions or where data integrity is paramount.

Fast

Suitable for most applications.

Unsafe

Only recommended for experimental purposes, low-value transactions where the risk of reorg is acceptable, or in specific scenarios where immediate confirmation is more critical than data integrity (e.g., certain types of data feeds where eventual consistency is sufficient). Thoroughly understand the implications before using this option.

Recommended Values for Block Finalization

Below is a list of recommended values for block finalization for different networks and finalization types.

Network
Standard
Fast
Unsafe

Base

195

30

1

Entangle

1

1

1

Ethereum

32

12

1

Mantle

195

30

1

Avalanche

5

2

1

Sonic

20

10

1

Polygon

100

50

1

Solana

32

16

2

Berachain

5

2

1

Binance

40

5

1

Arbitrum

1500

240

5

Abstract

900

20

1

Manta

40

5

1

Immutable

195

20

1

Optimism

195

30

1

PreviousCalculate Cross-Chain Transaction CostNextHow to Debug Sent Messages

Last updated 1 month ago

Was this helpful?

We're currently working on Solana integration as part of our next milestone. We have prepared guides for teams and developers interestered in early access. To learn more or request access, visit our .

contact page