Truebit Verify Hub
Last updated
Was this helpful?
Last updated
Was this helpful?
The Truebit Verify Hub is a layer of services that coordinate the execution and verification of tasks. The hub exposes secure API endpoints, manages requests and responses, and orchestrates executions for each Truebit Task.
The Dispatcher service processes task requests from Task Requesters and provides ingress interfaces for network protocols. The Dispatcher manages Node selection, including the collation of random bits from block hash and timestamp sources. After Node selection, the Dispatcher signs the task request and sends it to the Hub. Once the task is dispatched, it creates a unique ID <executionId> and starts the execution.
The Hub consists of a global message broker and required micro-services that facilitate task execution.
Imagine the Global Message Broker as a super-smart messenger that helps all the different parts of the Truebit node to share information without confusion. It lets services talk to each other, even if they're busy with their jobs.
When one service has something to say, it just sends a message to the Hub, and the bus makes sure the right service gets it.
After receiving a task request from the Dispatcher, the Hub’s execution service assigns a task ID, broadcasts the task to each assigned Node through the message bus, timestamps Node responses, and records errors.
The verification-service is the one that manages the different phases of the protocol. It is also responsible for checking the correctness of the syntactic responses and protocol adherence. Key checks include valid signatures, valid execution ID, valid Node address, message schema validation, and no duplicate messages.
The API Adapter uses information from the task requester and instructions from the developer to communicate with the API Provider. It checks if the information given by the requester and the results from using the API match what was expected according to the developer's guidelines. Then It gives the task requester a transparent execution result through the Truebit API transcript.
The timeout-service plays timekeeper, concurrently ensuring that each task adheres to the protocol’s time limits. In addition, it checks that necessary quorums and events, such as received solutions and its reveal periods, transpire before their expected expiration.
The transcript-writer ensures that the transcript (the source of truth for what happened during the task execution) and related files, such as invoices, are safely stored in our internal database.
The query-service is the one that returns the transcript of a specific executionId
The api-credentials service handles setting and retrieving API credentials within the vault service.
The vault-service is responsible for ensuring the security and integrity of all stored API credentials.
The ledger adapter abstracts interaction with the various ledgers from the rest of the Hub. It also listens to relevant ledger events and forwards them to the appropriate queue inside the Hub for processing.
The accounting service calculates and issues payments and penalties according to Hub-attested transcripts. Its roles include semantic validation of transcript ensembles and processing settlements on the payment ledger
The global code share acts as a secure vault designed to store and manage Truebit tasks efficiently. Each Truebit task is assigned a unique identifier known as a <taskId>.
The global transcript store is the repository for messages in the transcript and related documents such as the invoices.