Query invoices with Request using The Graph Decentralized Network

Alexandru Stoicescu

Jun 13, 2022

5 min.

Request Network’s vision is to build a global decentralized invoicing network as the backbone of world trade. One where payment data is public good, rather than a siloed privilege.


Built on the Ethereum blockchain and IPFS storage network, the protocol allows for the automatic payment detection and reconciliation of payment transactions.


In order to allow supporting and scaling of our payment detection feature, Request partners with The Graph, an indexing protocol for querying data for blockchain networks such as Ethereum, Gnosis chain, Avalanche, and NEAR and makes their data easily accessible.


What it means for Request Network is that it provides an easier way to retrieve specific payment reference data from the blockchain and reconcile it to payment requests, within the web3 principles of decentralization and reliability.


By joining forces with The Graph, Request Network accelerates its mission of providing access to an open payment data for the crypto economy in order to displace the incumbent web2 monopolies.


How The Graph indexes blockchains

A blockchain is an immutable, append-only distributed database. Transactions cannot be sorted based on relevancy but simply added at the time of creation. To find information about a specific transaction, one would require searching the entire blockchain, starting from the beginning (i.e. the first block). If the data is not found in the first block, the search would have to move to the second block, and so on.


The underlying design of a blockchain means querying data from the blockchain is computationally intensive, expensive, and time-consuming.


The Graph is solving the critical problem of efficiently accessing blockchain data by implementing a decentralized data economy and a library of open-source APIs called subgraphs.


A subgraph defines a standard way to index data from blockchains and storage networks. Anyone can build a subgraph or query an existing one, thanks to their open-source nature.


The Graph provides a hosted Service to store the subgraphs in the event one does not want to run a local Graph node. The Graph announced earlier in 2022 that it shall be gradually discontinuing its hosted service and migrating dapps to its decentralized network.


How Request uses The Graph for querying payment data

Prior to using The Graph, Request would have a custom and time-consuming indexing mechanism, with scaling issues.


There are efficient indexing services that enable fast queries, but they are controlled by private, centralized entities.


Besides being an industry leader in providing the data infrastructure layer for indexing, we view The Graph as a powerful catalyst for composability, enabling two or more dapps to integrate together.


As a cross-chain payment requests protocol, Request uses multiple subgraphs for indexing and organizing data from the Request smart contracts. Each subgraph has a dedicated endpoint for querying data, as well as a page on The Graph explorer that exposes the schema and available fields to query. All Request subgraphs can be viewed here.


To date, most of these subgraphs are hosted on The Graph hosted service and can be used to query Request payment data.


“The Graph enabled us to unify the index data of all our payment proxies in a single place, so monitoring for events is now much simpler. With the recent migration to their decentralized network, we expect higher uptime and overall performance compared to their hosted service, and we’re happy to pay for it”, said Benjamin Levesque, Software Architect at Request.

 

As part of its transitional phase of migrating subgraphs off the hosted service to the decentralized network, to date, only the Request subgraph on Ethereum mainnet subgraph has been migrated. See the subgraph here.


As a developer, Request pays querying fees on The Graph. At Request, we have also opted to become curators as well to signal our own subgraph to indexers.


How the Request community can champion decentralization of payment data as Curators

As a permissionless protocol, anyone can publish a subgraph. While this promotes decentralization, it also introduces a risk for fraudulent subgraphs. As a solution to this problem, The Graph protocol introduced the role of Curators. Curators deposit GRT (The Graph’s utility token) on subgraphs to signal its importance.


Curation of subgraphs is a decision-making tool for Indexers that is used to decide which subgraphs to index. The economic incentive for Curators is that they earn 10% of all query fees, pro-rated to their curation shares.


When Curators deposit GRT on a subgraph for signaling, they are depositing their GRT into a bonding curve, similar to Algorithmic Market Maker (AMM) like Uniswap. Hence signaling means minting new shares and un-signaling means burning shares. As a Curator, it’s important to know that when you burn your curation shares to withdraw GRT, you can end up with more or less GRT than you initially deposited.


To help improve the signaling strength of our subgraph (only on mainnet for now), the Request community can participate in acting as Curators. As a disclaimer, we strongly advise the community to do their own research to understand the following considerations;

  • The economic risk of curating

  • The state of the market


As a proponent of decentralization, at Request, we shall be supporting the mission of The Graph to discontinue their hosted service and gradually move our subgraphs to their decentralized network, so builders on the Request ecosystem can partake in making the web3 vision a reality.

Sign up to our newsletter

We value your privacy

Sign up to our newsletter

We value your privacy

Sign up to our newsletter

We value your privacy