How it works
End-to-end flow from your application to a verified label with on-chain settlement.
Pipeline
Your Data → Gateway API → Aerospike → Task Router → Workers
↓
Labels (×N workers)
↓
Consensus
(majority vote)
↓
Settlement
(BSV micropayment)
↓
Verified Label + bsv_txid
↓
Gateway Result API → You
Your data
You send HTTPS requests to ASG Gateway with a public URL to the payload (data_url) and a structured label_spec (question + options, etc.). Gateway validates the request, applies quota and rate limits, and writes a task record tagged with your cust_id for tenant isolation.
Gateway API → Aerospike
Tasks live in a shared namespace with ASG Refinery (e.g. set tasks). Gateway sets source=gateway, status=pending, and stores task_type, label_spec, consensus_threshold, and optional callback_url / webhook routing fields.
Task Router → Workers
Refinery’s Task Router assigns work to workers. Each worker submits a label; you need enough labels to evaluate consensus (see Consensus).
Consensus
When enough labels exist, the engine checks majority agreement against your threshold. If agreement is reached, the task moves toward verified / settled. If workers disagree persistently, the task can remain in_progress until timeout or more labels — see Task lifecycle.
Settlement
Settlement pays workers who agreed with the consensus outcome in satoshis on BSV. The transaction id bsv_txid is your audit trail. Details: Settlement.
Results back to you
Poll GET /v1/tasks/{id}/result or receive task.settled webhooks. The Gateway never exposes other customers’ tasks.
Related: Consensus · Settlement · Task lifecycle