Skip to Content
⚠️ Alert: Sylan is under active development—only trust contract/wallet addresses announced on our official channels; we will never DM you, ask for funds, or run surprise airdrops/presales.
ArchitectureOn-Chain vs Off-Chain

Architecture — On‑Chain vs Off‑Chain

This page defines what lives on‑chain (immutable/accountable) and what runs off‑chain (scalable/flexible), and why. Use this as a placement guide when building clients, nodes, and provider integrations.


Principles

  • Trust minimization: put verification and funds movement on‑chain; keep raw data off‑chain.
  • Cost & latency: on‑chain steps are gas‑bounded and slower; off‑chain steps are low‑latency and scalable.
  • Privacy: only hashes/IDs go on‑chain; payload bytes and PII remain off‑chain.

Responsibilities by layer

LayerRuns whereStores / ExecutesGuaranteesCostsExamples
AccessRegistryOn‑chainAPI descriptors, plans (PPC/Subscription), per‑API freshness & consistency params, provider signerDiscoverability, integrity (contentHash), parameter source of truthGas to update; free to read off‑chaindescriptorOf(apiId), apiPlan(apiId)
APIEscrowOn‑chainLock/purchase, settlement/refund, pull‑payment balances, fee BPS snapshotCorrect accounting, no reentrancy, idempotent settlementGas to lock/settle/withdrawlockForCall, purchaseSubscription, withdraw
APIConsensusOn‑chainVote tally of provider‑signed Snapshots, finalize success/failureOnly Provider‑authorized data can win; quorum/expiry rulesGas per snapshot/finalizesubmitSnapshot, finalize
NodeRegistryOn‑chain (optional)Active set, stake, slashing/rewardsNode eligibility & incentivesGas to (un)stake/slashstake, slash
EventLoggerOn‑chainCurated human‑readable eventsAuditabilityMinimalProtocol‑emitted logs
Provider APIOff‑chainRaw responses; publishes artifacts (or bytes) that hash to contentHashPerformance, business logicInfra costREST/GraphQL, streams
Provider SignerOff‑chainEIP‑712 signing of SnapshotAuthorizationHSM/HW walletSigns { apiId, seqNo, providerTs, ttl, contentHash }
Sylan NodesOff‑chainFetch, verify, submit snapshots; optional artifact pinningThroughput; replicationInfra costSubmit to Consensus
Storage (IPFS/HTTPS)Off‑chainHost artifacts addressed by contentHashIntegrity via hash matchStorage/bandwidthipfs://..., https://...
Indexers/Dashboard/SDKOff‑chainListen to events; render UX; derive analyticsUX/state materializationApp infraMarketplace & receipts

Contract addresses & ABIs are listed under Architecture → Addresses & ABIs. Event signatures under Architecture → Events.


What lives where (by data type)

  • Identifiers (on‑chain & cross‑layer): apiId (bytes32), requestId (deterministic), requestHash (bytes32), contentHash (bytes32), optional pointerURI.
  • Economic state (on‑chain): escrow balances, fee snapshots, staking balances, subscription purchases.
  • Policy/params (on‑chain): plans (price/duration/callLimit), BPS splits, maxSkewMs, maxTtlMs, seqMonotonic, providerSigner, activation flags.
  • Payload bytes (off‑chain): HTTP/WS responses, bulk files, Merkle trees, logs/metrics.
  • Artifacts (off‑chain, content‑addressed): compressed JSON/CBOR/Parquet, CSVs, or merklized chunks that hash to contentHash.

Flow with boundaries (happy path)


Failure modes & who recovers

ScenarioWhat failsExpected behaviorWho fixes
Provider outageOff‑chain data sourceNodes cannot gather votes → NoQuorum; PPC refundsProvider restores service
Node churnOff‑chain votersEarly quorum may not be reached; deadline path still finalizesNode operators scale/replace
Chain congestionOn‑chain txsSnapshot/finalize delayed; choose wider expiry windowsUsers set expiresAtMs prudently; nodes use higher gas
Signer compromisedOff‑chain keyRotate providerSigner via Registry; alert consumersProvider governance
Descriptor driftOff‑chain docs/schemaVersion bump; contentHash change; clients refreshProvider + clients

Latency & gas guidance (conceptual)

  • Client expiry: set expiresAtMs to allow for fetch + vote + finalize under normal network load; cap by maxRequestExpiryMs.
  • Snapshot size: keep artifacts small or merklized so contentHash represents a compact root; only the hash is on‑chain.
  • Event‑driven UI: drive state from RequestRegisteredResponseSubmittedRequestFinalized/RequestFailedSettled/Refunded.

Privacy & compliance defaults

  • Never emit raw payloads on‑chain; emit only hashes and IDs.
  • Avoid PII in descriptors or artifacts; if unavoidable, encrypt at rest off‑chain and publish the hash of the ciphertext.

Upgrade & governance boundaries

  • On‑chain upgrades via UUPS and multisig owners; subject to pause/unpause.
  • Off‑chain components (Nodes, Provider infra, indexers) can deploy continuously but must remain protocol‑compatible (hashing, EIP‑712, params).

Checklist

  • On‑chain: everything needed to verify & settle; nothing that leaks data.
  • Off‑chain: deterministic hashing, signature verification, artifact pinning.
  • SDKs: boundary‑aware helpers (request hashing, snapshot verify, event subscriptions).
  • Ops: monitors for on‑chain events + off‑chain uptime.

See also

  • Components (system map)
  • Addresses & ABIs (contract endpoints)
  • Events (UI/indexer hooks)
  • Request Lifecycle, Consensus, Data Integrity (deep dives)
Last updated on