deBridge
  • Introduction
  • The deBridge Messaging Protocol
    • Protocol Overview
    • Fees and Supported Chains
    • 🟢Deployed Contracts
    • Development Guides
      • Building an EVM-based dApp
        • EVM smart contract interfaces
          • Interfaces
            • ICallProxy
            • IDeBridgeGate
            • IDeBridgeToken
            • IDeBridgeTokenDeployer
            • IOraclesManager
            • ISignatureVerifier
            • IWethGate
          • Libraries
            • Flags
          • Periphery
            • CallProxy
            • DeBridgeToken
            • DeBridgeTokenProxy
            • SimpleFeeProxy
          • Transfers
            • DeBridgeGate
            • DeBridgeTokenDeployer
            • OraclesManager
            • SignatureVerifier
            • WethGate
      • Sending cross-chain messages from Solana
        • On-Chain external call preparation for Solana
        • Off-chain external call preparation for Solana
      • Lifecycle of a cross-chain call
      • Gathering data for the claim
    • Development Tools
    • Security
    • Slashing and Delegated Staking
  • 🔁DLN: The deBridge Liquidity Network Protocol
    • Introduction
    • Protocol Overview
    • deBridge Hooks
    • Fees and Supported Chains
    • 🟢Deployed Contracts
    • Market and Limit Orders
    • Integration Guidelines
      • Interacting with the API
        • Authentication
        • Creating an Order
          • Quick Start
          • API Parameters
            • Estimation-Only
            • prependOperatingExpenses
          • API Response
            • JSON Example
          • Refreshing Estimates
        • Tracking Order Status
          • Order States
        • Integrating deBridge hooks
          • Creating Hook data for Solana
        • Submitting an Order Creation Transaction
        • Cancelling the Order
      • deBridge Widget
      • Interacting with smart contracts
        • Placing orders
        • Filling orders
      • Under the Hood
        • Reserve Assets
        • Bridging Reserve Assets
        • Bridging Non-Reserve Assets
        • Order Fulfillment
          • Detecting the Order
          • Fulfilling the Order
            • Pre-Fill-Swap
          • Claiming the Order
      • Affiliate fees
        • Withdrawing Affiliate Fees
      • Fees and operating expenses
    • Interacting with the deBridge App
      • Custom Linking
    • Protocol specs
      • Deterministic order ID
      • Hook data
        • Anatomy of a Hook for the EVM-based chains
        • Anatomy of a Hook for Solana
  • 💸dePort
    • Getting started
    • Transfers Flow
  • ⚡deBridge Points
    • Referrers Overview
    • Integrators Overview
  • 🌐deBridge IaaS
    • Getting started
  • 🌐Legal
    • SDK & API License Agreement
  • External Links
    • deBridge Use Cases
      • 💡Examples
    • Talks, Videos, and Articles
    • Website
    • Github
    • Twitter
    • Social channels
      • Discord
      • Facebook
      • LinkedIn
      • Medium
      • Telegram
      • YouTube
Powered by GitBook
On this page

Was this helpful?

  1. DLN: The deBridge Liquidity Network Protocol
  2. Protocol specs

Deterministic order ID

An order placed onto DLN is identified by a deterministic keccak256 hash derived from an array of bytes that contains all the properties of the order. The array is designed to be cross-chain compatible, so the smart contracts residing on both EVM and Solana can easily reproduce it. The smart contracts implementing the DLN protocol usually accept all these properties as a single data struct and derive an orderId programmatically to guarantee the order with the proper orderId is being managed.

To get the deterministic orderId of the order, the array of bytes should contain its following properties:

| Bytes | Bits | Field                                                |
| ----- | ---- | ---------------------------------------------------- |
| 8     | 64   | Salt                                                 |
| 1     | 8    | Maker Src Address Size (!=0)                         |
| N     | 8*N  | Maker Src Address                                    |
| 32    | 256  | Give Chain Id                                        |
| 1     | 8    | Give Token Address Size (!=0)                        |
| N     | 8*N  | Give Token Address                                   |
| 32    | 256  | Give Amount                                          |
| 32    | 256  | Take Chain Id                                        |
| 1     | 8    | Take Token Address Size (!=0)                        |
| N     | 8*N  | Take Token Address                                   |
| 32    | 256  | Take Amount                                          |                         |
| 1     | 8    | Receiver Dst Address Size (!=0)                      |
| N     | 8*N  | Receiver Dst Address                                 |
| 1     | 8    | Give Patch Authority Address Size (!=0)              |
| N     | 8*N  | Give Patch Authority Address                         |
| 1     | 8    | Order Authority Address Dst Size (!=0)               |
| N     | 8*N  | Order Authority Address Dst                          |
| 1     | 8    | Allowed Taker Dst Address Size                       |
| N     | 8*N  | * Allowed Taker Address Dst                          |
| 1     | 8    | Allowed Cancel Beneficiary Src Address Size          |
| N     | 8*N  | * Allowed Cancel Beneficiary Address Src             |
| 1     | 8    | Is Hook Presented 0x0 - Not, != 0x0 - Yes            |
| 32    | 256  | * Hook Envelope Hash                                 |
PreviousProtocol specsNextHook data

Last updated 8 months ago

Was this helpful?

🔁