The APIS Docs
HookDiscordContact Us
  • ☺️Hello, Web3!
  • ↔️About The APIS
    • Introduction
    • Core Team
    • Our Partners
  • 🤖Roadmap
  • 🍦Products
    • 🔍Hook
      • Get Started
        • Explore
        • Calendar
        • Collections Trending
        • Watch List
      • Twitter RSS
      • Chatting /w Community
    • ❄️Data Lake
  • 🤓Academy
    • On-Chain Glossary
      • NFT
      • DeFi
  • ℹ️$API Token Info
    • 🅰️$API Smart Contract Address
    • 🪙Token Economics
      • $API Token Utility
      • $API Token Distribution
      • Dune Analysis
      • Investors
      • FAQs
        • What is API?
        • How do APIs work?
        • What is the API token?
        • Why does API stand out?
        • What does API mean for the crypto industry?
    • 📈Get $API Token
    • ⬆️Listed Exchanges
  • 🤝Get In Touch
    • 🥰Contact Us
    • 🥰Join Us
    • ❓FAQ
  • 📖Docs
    • 🔐Security
      • 📄Security Report by Certik
    • 📄Terms & Conditions
    • 📑Privacy Policy
    • ℹ️Disclaimer
  • 📃Whitepaper
    • Whitepaper
      • 1️⃣1⃣ Background
        • 1.1 Background
        • 1.2 Introduction
      • 2️⃣2⃣ Architecture
        • 2.1 Message Propagation Protocol
        • 2.2 Message Formatting Overview
        • 2.3 APIS Core Contracts
        • 2.4 Governance Contract (GC)
        • 2.5 Dispute Resolution Contract (DRC) Factory
        • 2.6 Optimistic Rollup Contract
      • 3️⃣3⃣ Applications
        • 3.1IDs
        • 3.2 API Token
        • 3.3 Token Distribution, Community Ownership
      • 4️⃣4⃣ Discussion
      • 5️⃣5⃣ Appendix
        • 5.1 REST History and Analysis
        • 5.2 REST APIs in Practice
        • 5.3 Strengths and Weaknesses of REST
        • 5.4 GraphQL History and Analysis
        • 5.5 GraphQL as a ‘Fetching Tree’
        • 5.6 Anatomy of a GraphQL Request
        • 5.7Note on GraphQL Resolvers:
        • 5.8 Direct Comparison
        • 5.9 Weaknesses of GraphQL
      • 6️⃣6⃣ Bibliography
Powered by GitBook
On this page
Edit on GitHub
  1. Whitepaper
  2. Whitepaper
  3. 2⃣ Architecture

2.1 Message Propagation Protocol

Previous2⃣ ArchitectureNext2.2 Message Formatting Overview

Last updated 3 years ago

The APIS Network is composed of two actors, both of which are open and configurable by any party: APIS Gateways and APIS Nodes. Queries requested by decentralized applications and their developers are responded to by APIS Gateways, while APIS Nodes index and manage databases pertaining to one or a group of smart contracts, such that APIS Nodes can respond to APIS Gateway requests with an average response time of 400ms (ϵ(t) < 400ms), under the condition that the requested endpoint from the APIS Gateway is already maintained by an APIS Node.

Communication between Gateways and Nodes is maintained through a brokerless, libp2p publish-subscribe messaging protocol, wherein Nodes subscribe to messages from a Gateway, which they can receive directly from the Gateway or from additional Nodes who also have also subscribed to that Gateway’s messaging propagation, although Nodes should assume counterparty Nodes are adversarial at all times, per any well-designed crypto-economic system.

Gateways maintain a registry of the subscribing Nodes from which they request endpoints based on the <ID> of the endpoint, as Nodes will only index a select group of IDs. IDs are representational hashes of the datasets supported by the Network; only the hash of the ID is maintained on-chain in the Node and Gateway State Tries, described further in 2.6 Optimistic Rollup Contract. It is up to each Gateway to determine how to filter messages from Nodes for each endpoint response, although we recommend a first-in, first-out approach, wherein subsequent messages, should they differ from the first sent message, can provide the Gateway with evidence warranting of initiating a challenge, described further in 2.5 Dispute Resolution Contract Factory.

📃
2️⃣
Figure 2.1.1: APIS Network Message Propagation Protocol.