Skip to main content
SQD Network uses smart contracts for registration and token accounting. It uses offchain services for storing blocks, scheduling copies, transporting queries, and returning results.

Identity connects the two sides

A worker or Portal generates a libp2p keypair. The public peer ID derived from that key identifies the node on the peer-to-peer network. Registration or allocation transactions associate that peer ID with an onchain account and locked SQD. The private key stays with the node operator. It is used for peer identity and signed network messages; it is not stored in a smart contract.

Contracts coordinate participation

The current Network contracts include separate responsibilities:
  • WorkerRegistration records worker peer IDs, bonds, registration epochs, and deregistration state.
  • NetworkController stores parameters such as epoch length, worker bond amount, expected worker storage, target capacity, and reward limits.
  • Staking records SQD delegated to each worker and accounts for each delegator’s share of distributed rewards.
  • allocation contracts account for the query capacity associated with SQD locked by data consumers or Portal operators.
  • reward contracts accept approved reward batches and make worker and delegator rewards claimable.
These contracts do not decide which Parquet file answers a request. The assignment and Portal make that routing decision offchain.

Offchain services carry the data

Chunks can be much larger than an onchain transaction and queries need low-latency streaming. The archive, scheduler, worker, and Portal services therefore operate offchain:
  1. ingestion writes finalized chunks to persistent storage;
  2. the scheduler publishes a chunk-to-worker assignment;
  3. workers download their assigned chunks;
  4. Portal sends queries to workers over libp2p and returns the results over HTTP;
  5. collectors record heartbeats and logs used for operations and analysis.

Run a worker

Follow the worker setup and registration procedure.

Delegate SQD

Follow the current delegation and withdrawal procedure.

Run Portal

Choose a hosted or self-hosted Portal path.

Network contracts

Read the deployed addresses, contract responsibilities, and Solidity source.

Implementation sources