This document is the technical specification for the Graph Horizon protocol, it describes the main functionality of each contract and provides some implementation guidelines. Worth noting that this document describes the end state for the protocol, intermediate stages like the transition period during the Horizon upgrade are not considered here.
The following is a list of all protocol contracts by category:
GraphToken
: The GRT token contract. Not covered in this document as it’s an immutable ERC20 contract already deployed.HorizonStaking
: Implements the staking protocol.IPaymentCollector
: Interface for a payment collector implementation.PaymentsEscrow
: Holds payer funds in the payments protocol.GraphPayments
: Implements payment collection and distribution.RewardsManager
: Issues GRT as rewards for approved data services.Curation
: Signal GRT to subgraphs, indexing rewards are proportional to curation signal.BridgeEscrow
and GraphTokenGateway
: Custom Ethereum - Arbitrum bridge.EpochManager
: Keeps track of epochs in the protocol.Controller
and GraphProxyAdmin
: Governance contracts.The staking protocol is the core of Graph Horizon. It provides the staking layer for data services to use as economic security and the primitives to build upon. The staking protocol is implemented by a single contract, HorizonStaking
, which should have no external dependencies other than the GraphToken
contract.
HorizonStaking
contract<aside> ⚠️ A note on terminology. Receiver is the generic term for an entity receiving a payment through the payments protocol. If the payment is originated via a data service this will be the service provider.
</aside>
The payments protocol consists of two main contracts and an arbitrary amount of collector contracts:
GraphPayments
, the contract making the payment collection and distribution.PaymentsEscrow
, the contract where the payments are collateralized.IPaymentCollector
interface. These are the contracts allowed to pull funds from the PaymentsEscrow
and run them through GraphPayments
.IPaymentCollector
interfacePaymentsEscrow
contractGraphPayments
contractCollectors can be permissionlessly developed and used with the payments protocol, GraphTallyCollector
is the first one that will be available in Graph Horizon. It’s designed to be used with the Graph Tally protocol, formerly known as “Timeline Aggregation Protocol v2 (TAP)”.
GraphTallyCollector
contract