Contract Overview

The ZAP platform currently exists as as a collection of contracts on the Kovan testnet. A list of the five main contracts and their purposes follows.

ZapToken: serves as a ledger for the zap tokens which may be bound to any data provider in return for finite access to a provider's data. The amount of access granted per token is based on provider defined supply/cost curve.

Registry: where data providers themselves are represented as structures in which public keys for data/query encryption, account addresses, bond pricing parameters and endpoint-specific parameters are housed.

Bondage: data-provider endpoint specific bonding is performed via this contract.

defines the available pricing curves in plots of access-cost(dot-cost) versus access-supply(dot-supply) based on provider defined parameters
calculates request/subscription prices for given data providers via 'dot' prices.
holds dots in escrow between user and provider during subscriptions and pending transactions
allows ZAP to be bound for dots at price defined by point on provider specific curve
allows dots to be burned for ZAP at price defined by point on provider specific curve

Dispatch: handles delivery and bond-market interface for smart contract endpoints (ex. a smart contract-powered futures contract for crypto-exchange prices which queries a data-provider, or "oracle", for BTC-ETH spot price at a timestamp)

Arbiter: handles data delivery and bond-market interface for temporal subscriptions. The first temporal subscription endpoint we are building out consists of IPFS Publisher/Subscriber socket subscriptions. (ex. user wishes to subscribe to a real time data feed for 2 hours)

Registry, Bondage, Dispatch, and Arbiter storage is decoupled from their logic, allowing these contracts to be securely updatable.

For example, an oracle(provider) answering queries for sports data will deploy a 'Sports Data' endpoint and price-supply function. If costs are uniform, this function will simply be a constant( the price per query), DOT-PRICE = 10

Another provider might offer subscriptions to market event signal data via a website. In this case, 1 DOT may be redeemable for 1 hour of signaling data. This hypothetical "Market Signals" provider has limited bandwith to provide socket data to subscribers and may decide to deploy a 'Market Singals" endpoint which increases in costs the more unspent dots have been issued and limited the total number of unspent dots to 100.