DINX_Indexer
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    **DINX Yellow Paper** **Background** Prior to the release of DINX, all inscription protocols in the market followed a similar principle. Protocol information is transmitted on-chain through UTXO/CallData, and off-chain indexers decode and process this information according to the protocol standards. ![image](https://hackmd.io/_uploads/rJqKKiJUA.png) The above method has several drawbacks: 1. **Latency Issues:** Off-chain indexers need to fetch data from the blockchain and then decode and process it. This process can cause significant delays, especially when dealing with large amounts of data, potentially failing to meet real-time requirements. 2. **Reliability Issues:** Off-chain indexers rely on external services. If these services fail or are attacked, the entire data processing chain can be affected, leading to data inconsistency or loss. There is also a risk of inconsistency between on-chain data and data processed by off-chain indexers, particularly when errors occur during data synchronization or processing. Ensuring data consistency requires additional mechanisms and methods. 3. **Security Issues:** The security of off-chain indexers depends on the implementation and deployment environment. If attacked, it could lead to data leaks or tampering. Additionally, on-chain data may face risks of interception or tampering during transmission. 4. **Complexity Issues:** This approach requires handling both on-chain and off-chain data, resulting in high development and maintenance costs. Parsing and indexing on-chain protocol information requires a deep understanding of blockchain and data indexing technology, increasing the complexity of development and maintenance. As the data volume increases, the load on off-chain indexers also increases, potentially leading to performance bottlenecks and affecting system scalability. DINX provides a more efficient and reliable solution through its distributed index architecture, better addressing the needs for large-scale data processing and real-time queries. **Project Introduction** DINX, short for Distributed Indexer, aims to offer a more efficient and reliable solution through its innovative distributed index architecture. By introducing Layer 1.5 architecture, multi-signature index verification, performance reliability proof validation nodes, and OP fraud proof, DINX ensures the consistency and security of inscription data, significantly enhancing market trust and reliance on data indexing systems. The DINX system not only inherits the security and decentralization characteristics of Layer 1 public chains but also introduces the scalability and high-performance features of Layer 2 solutions. It can quickly handle large-scale datasets and support real-time queries, making it a universal solution suitable for all inscription indexing environments. **Market Analysis** The current blockchain inscriptions market increasingly demands efficient, secure, and reliable data indexing. Historical events have exposed the flaws and vulnerabilities of existing indexing mechanisms, causing market confusion and user frustration. These incidents also highlighted the inadequacies of current indexing systems in handling large-scale data and real-time queries. ![image](https://hackmd.io/_uploads/SkcxcikL0.png) **System Architecture Layer 1.5 - Blockchain-Based Database** DINX uses a blockchain-based database to unlock new storage media, constructing a virtual blockchain to store all transaction data types for various types of protocols. This blockchain is referred to as Layer 1.5, a new blockchain architecture positioned between Layer 1 and Layer 2, designed to provide efficient storage and data management capabilities. It inherits the security and decentralization of Layer 1 public chains while introducing the scalability and high performance of Layer 2 solutions. Through this architecture, DINX provides an efficient storage layer for managing and indexing large-scale transaction data. - **MPT Tree Structure:** Data is stored using a Merkle Patricia Tree (MPT) structure to ensure efficient storage and quick retrieval. The MPT tree structure can effectively organize and manage large amounts of data, offering strong data consistency and integrity verification capabilities. All stored data can be verified through hash values, ensuring data integrity and immutability. - **Virtual Presence:** Layer 1.5 is a virtual chain, different from traditional physical blockchains, focusing on efficient data storage and processing rather than full consensus characteristics. DINX uses this virtual chain, employing a unique data storage structure to store all verified inscription data efficiently. - **Multi-Protocol Support:** Layer 1.5 supports various protocol types for data storage and management, compatible with protocol standards in different application scenarios. - Multi-Signature Index Verification When protocol beacon nodes submit data proofs to Layer 1.5, they must be verified by a protocol committee through multi-node signature verification. Only when more than half of the signing nodes approve the data will it be submitted to the corresponding farm pool in Layer 1.5. This serves as the first firewall for maintaining inscription data consensus. ![image](https://hackmd.io/_uploads/S14dnj1UA.png) ![image](https://hackmd.io/_uploads/rJ1K3sk80.png) Thus, a virtual chain structure tree is constructed, with the root node changing as protocol transactions increase. The root hash *Hroot* is the top-level hash of the entire tree, used to verify the tree's integrity: - Leaf node hash: $$H_{leaf} = \text{Hash(d)}$$ - Branch node hash: $$H_{branch} = \text{Hash}(H_{child1} \parallel H_{child2} \parallel \cdots \parallel H_{child_n})$$ - Root hash: $$H_{root} = \text{Hash}(H_{branch1} \parallel H_{branch2} \parallel \cdots \parallel H_{branch_n})$$ - ![image](https://hackmd.io/_uploads/r1mcniJ80.png) Thus, DINX ensures the first layer of efficient, secure, and consistent communication between Layer 1 and Layer 1.5. Reliability Proof DINX divides the overall validation into countless probabilistic verification topics. When probabilistic verification reaches a sufficiently high level, it can counterprove the reliability of the overall validation, ensuring the second layer of DINX consensus. We can prove the reliability of any virtual block: - P represents the probability that the submitted state data is correct. - Q represents the probability that the submitted state data is incorrect. - n represents the number of verifications within the challenge period. - ϵ represents the error probability of each verification, i.e., the probability that a correct state is mistakenly identified as fraudulent. The probability of a single verification being correct is 1 - ϵ. Suppose that out of k verifications, at least m verifications are correct. We can use the binomial distribution to calculate the reliability of the overall verification. Single verification reliability formula: R = 1 - ϵ Multiple verification reliability formula: Let B(n,p) represent the binomial distribution, indicating the number of successes out of n independent trials, where the probability of success is p. ![image](https://hackmd.io/_uploads/H1VOajyIR.png) **Proof Rewards** In the DINX system, to encourage users to actively participate in data validation and submit reliability proofs, we introduce a verification mechanism based on smart contracts. When users submit a reliability proof, it can be automatically verified by a smart contract, and the user is rewarded accordingly. To ensure fair distribution of rewards, DINX has added the following limitations: **Verification Frequency** Within a single Layer 1.5 block, only N provers are allowed to receive rewards. This means that multiple users cannot receive rewards for submitting the same or different fraud proofs within the same block, preventing duplicate rewards. **Interval Absolute Value** After a proof is submitted and confirmed, the next block submitter’s proof virtual block number must be absolutely larger than the previous confirmed block. This ensures the random distribution of blocks and prevents users from submitting proofs concentrated in specific blocks. Specifically, the absolute block value is: $$\|\text{VirtualBlock}_n - \text{VirtualBlock}_{n-1} \| \geq \frac{\text{Height}}{4}$$ ![image](https://hackmd.io/_uploads/SJQ_CiJLC.png) **OP Fraud Proof** Optimistic Rollup Fraud Proof (OP Fraud Proof) is a mechanism used to ensure data correctness and security in blockchain scaling solutions, commonly used in Optimistic Rollup (ORU) schemes. In the constructed blockchain-based database of DINX, it serves as the third layer of inscription data consensus. DINX improves blockchain throughput and efficiency by moving most computation and storage to the Layer 1.5 EVM virtual machine. However, to ensure the correctness of data processing results, a mechanism is needed to prevent malicious actors from submitting incorrect results. This is where fraud proofs come in: - **Transaction Submission:** Transactions are processed by several traditional inscription nodes adopting PoS consensus. They are first processed off-chain and filtered according to rules, then submitted collectively to the corresponding farm contract in Layer 1.5 via multi-signature. Nodes need to stake a symbolic amount of the corresponding inscription protocol to become valid registered nodes. - **Optimistic Assumption:** The submitted state data is assumed to be correct, and the blockchain temporarily accepts the newly submitted data and state root without immediately verifying its correctness, thus calculating the index state. - **Challenge Period:** After new state submission, there is a predetermined challenge period during which anyone can challenge the submitted state root, suspecting it contains fraudulent behavior. - **Fraud Proof:** If someone raises a challenge, they must provide fraud proof, demonstrating that the submitted state root is incorrect. Fraud proof typically includes a set of transaction data and computation steps, showing the calculation process from the previous state root to the current state root and pointing out the errors. When fraud proof reaches a certain amount, a rollback procedure is initiated. Layer 1.5 will roll back to the corresponding block height, repair the data, and recalculate and update all state roots for that height and subsequent heights. **Consensus Mechanism** In the DINX system, the consensus mechanism is the core to ensure data consistency and correctness among all nodes in a distributed system. DINX adopts an innovative scheme combining multiple consensus mechanisms to enhance system security, scalability, and efficiency. ![image](https://hackmd.io/_uploads/SJfnRi18C.png) **1. Basic Consensus Mechanism: PoS (Proof of Stake)** DINX constructs a Layer 1.5 public chain using PoS (Proof of Stake) as the basic consensus mechanism to build a blockchain-based database for storing all inscription protocol data. **2. Multi-Signature Index Verification** In the DINX system, data submission and verification adopt a multi-signature index verification mechanism. This mechanism ensures the correctness and security of the data submitted to Layer 1.5. **3. Reliability Proof** DINX ensures the reliability of the submitted state data through probabilistic verification. The overall validation is divided into numerous probabilistic verification topics, and when probabilistic verification reaches a sufficient level, it can counterprove the overall validation's reliability. **4. OP Fraud Proof (Optimistic Rollup Fraud Proof)** DINX introduces the OP fraud proof mechanism on Layer 1.5 as the third layer of inscription data consensus firewall. This mechanism ensures the correctness of data processing results and prevents malicious actors from submitting incorrect results. **System Modules Smart Contracts** ![image](https://hackmd.io/_uploads/Byykk2JUR.png) **System Contract** The Protocol System Contract serves as the entry point and dispatch center for all protocol data submissions, managing all operations related to the protocol. The System Contract collaborates with the Factory Contract and MPT Contract to ensure data uniqueness, constructs the MPT tree, and creates new Tick instance contracts through the Factory, updating the corresponding Tick contract status to maintain data timeliness and verifiability. **Factory Contract** The Factory Contract is mainly used to deploy and manage protocol-specific contract instances. Through the Factory Contract, DINX can dynamically create and initialize contract instances under different protocols, achieving modular and flexible contract deployment. - The Factory Contract is responsible for creating specific contract instances under different protocols (e.g., ATick Contract, BTick Contract). This design allows new contract instances to be generated dynamically as needed, without manual deployment each time. - The Factory Contract not only creates but also manages these contract instances, including initialization, configuration, and maintenance tasks. - Through predefined logic and permission control, the Factory Contract ensures that only authorized users and nodes can create and manage contract instances. **MPT Contract** The MPT (Merkle Patricia Tree) Contract mainly constructs the virtual block height of the protocol to maintain the protocol's virtual chain structure. The MPT Contract also provides effective output and verification of reliability proof and OP fraud proof, ensuring data integrity and consistency. **Tick Contract** The protocol specifies an EIP contract specification, defining methods for scheduling and coordinating operations within the protocol, ensuring that all operations are executed in an orderly manner according to predefined logic. RPC As a Layer 1.5 public chain, DINX will maintain a PoS blockchain infrastructure, with a complete set of RPC interfaces available for real-time access to the DINX blockchain's operational status and on-chain parameters. API (Beta) **1. GET `/api/protocolA/block/{blockHeight}`** ![image](https://hackmd.io/_uploads/rJWZlnyIC.png) **2. GET /api/protocolA/{address}/{tick}/balance** ![image](https://hackmd.io/_uploads/Hydfg31UA.png) **3. GET /api/protocolA/{address}/{tick}/history** ![image](https://hackmd.io/_uploads/B16VgnJLR.png) **Commercial Value** DINX will provide convenient services as an essential infrastructure in the inscription ecosystem, offering efficient data processing and verification services for wallets, exchanges, and other third-party services, enhancing decentralization, breaking the monopoly of existing index operators, and enabling ordinary users to participate in index verification. ![image](https://hackmd.io/_uploads/HJM8e2kUC.png) **Decentralization** **- Open Participation Mechanism:** The DINX system has designed an open participation mechanism, allowing any user to participate in data validation and index verification. Compared to traditional centralized indexing solutions, DINX significantly increases the system's degree of decentralization. This mechanism effectively breaks the monopoly of single index operators, making the data verification process more transparent and fair. **- Distributed Indexing:** Through a distributed indexing architecture, DINX distributes data processing and verification across multiple nodes, reducing dependence on single index operators, enhancing the system's resistance to attacks, and improving data processing reliability. Ordinary users can participate in index data verification without deep technical backgrounds, greatly lowering the threshold for index participation. **- Multi-Protocol Support:** DINX supports data storage and management of various protocols, promoting interoperability and the development of a decentralized ecosystem across different protocols. **Aggregated Inscription Functionality for Third-Party Services** **- Wallet Applications:** Wallet services can integrate DINX's API interfaces to provide users with efficient inscription data submission and query functions. Additionally, wallets can leverage DINX's decentralized validation mechanism to enhance user data security and reliability. **- Exchanges:** Exchanges can use DINX's distributed indexing and verification services to achieve efficient management and verification of transaction data, ensuring the authenticity and immutability of transaction data. By integrating DINX's API, exchanges can offer more efficient and secure trading services. **- Decentralized Applications (dApps):** Developers can use DINX's services to build various decentralized applications, such as decentralized social platforms, supply chain management systems, etc. These applications can fully utilize DINX's decentralization characteristics and efficient data management functions, enhancing user experience and data security. **Economic Model** The economic model will be announced upon official launch.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully