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.2 Message Formatting Overview

Previous2.1 Message Propagation ProtocolNext2.3 APIS Core Contracts

Last updated 3 years ago

Queries are sent by client-side applications directly to Gateways and returned by Gateways in industry standard GraphQL and REST formatting, thus allowing for the adoption of APIS by a global developer pool and consequently expanding the developer market of public blockchains. GraphQL and RESTful differentiate themselves in how they manage and return queries: GraphQL provides a single endpoint for the requested data, while REST provides multiple endpoints, which renders REST less efficient but also more customizable. REST has achieved more significant mainstream adoption than GraphQL due to its first-mover advantage and consequent well-known integrations; however, GraphQL can tailor its query responses to exactly what the query is requesting, thus ensuring that there is no overfetching of data and that the application only receives the data that it needs with one, unilateral mode of communication. We believe that GraphQL will ultimately overtake REST, but to encourage adoption by as many engineers as possible, APIS Gateways will support both API formats for the foreseeable future.

To maintain optimal communication between APIS Nodes and Gateways, APIS Nodes will only support RESTful requests at launch, as RESTful requests can be packaged by APIS Gateways into GraphQL format, through the APIS RG Converter, a proprietary but open-sourced technology that builds on the well-known stitching [15] and prefixing [16] techniques implemented in past conversation schemes. Thus, Gateways allows for the APIS network to support both types of queries by clients, while mitigating the operational intensity required to run an APIS Node. The APIS RG Converter can transform RESTful endpoint into a GraphQL endpoint (and vice-versa) in under 100ms (Ο΅ < 100ms), with an approximate success time of 95ms.

95ms, when added to the 400ms roundtrip estimation of message communication, renders a query to be returned in 500ms or less (Ο΅ < 500ms). The performance of the network will scale as the network scales, as Gateways and Nodes alike will compete with return queries under the fastest possible conditions, such as to win third-party client developer business. This is a long-term economic benefit of a protocol over a centralized aggregator, who can afford to innovate at a slower rate due to monopolistic market practices. However, in the interim, it is estimated that sub-500ms return times are adequate for decentralized finance and web user experiences.

πŸ“ƒ
2️⃣
Figure 2.2.1: APIS RG Conversion Time across internal practical tests.