Truebit Verify
  • Getting Started
    • 📄What is Truebit Verify?
      • How does Truebit work?
      • System Actors
    • ⏱️Get Started
    • ⚙️Architecture
      • Truebit Verify Hub
      • Truebit Verify Nodes
      • What is a transcript?
        • Transcript example
        • API Transcript example
    • Key Concepts
      • What is verification?
      • Determinism
      • WebAssembly
      • Task instrumentation
  • Developing Truebit Tasks
    • Introduction
    • Writing Function Tasks
      • Supported languages
        • Javascript
        • Python
        • Rust
    • Writing API Tasks
    • Task examples
      • Function Task examples
        • Fibonacci
        • Reverse Alphabet
        • Encrypt sha256 using bun.js
        • Encrypt sha256 using Deno
        • ECDSA signature verification
        • NumPy example
      • API Task examples
        • Pet Store CRUD
        • API-Auth examples
    • Namespace management
    • Task Authorization
    • Truebit CLI
      • secret.json
  • Executing Truebit tasks
    • Introduction
    • Task Execution API
      • Execute Function Tasks
      • Execute API Tasks
      • Get Task Status
    • Transcript API
      • Get Transcript
      • Get Invoice
  • Community
    • Truebit Unchained Protocol
    • Support
Powered by GitBook
On this page
  • Task Authorization Process
  • Truebit CLI Commands
  • Auth Commands
  • Accessing a Namespace
  • API_KEYS

Was this helpful?

  1. Developing Truebit Tasks

Task Authorization

The task authorization process means giving permission to one or multiple users to execute a deployed and registered task.

PreviousNamespace managementNextTruebit CLI

Last updated 2 months ago

Was this helpful?

The Task Authorization process enables the Namespace Owner to grant or deny permissions to one or more users for executing deployed and registered tasks within the namespace. This permission determines who can execute the task and who will be responsible for the associated costs

Task Authorization Process

    • The Task Requester can pass the created API key to someone else to execute the task. However, the one who registered the key will still pay for the execution: Imagine a development team consisting of several developers who need to execute the task. Each developer can have his/her own unique API key or share the same API key.

  1. Executing the Task: The Task Requester calls the execute endpoint using the API key.

During the Public Beta, Truebit will cover the cost of the task execution. To qualify, please ensure you’re registered on our platform.

Truebit CLI Commands

To interact with the TaskAuthorization smart contract, we created several commands within the Truebit CLI:

These commands help manage who can execute the deployed task and who will be responsible for paying for those executions.

Accessing a Namespace

API_KEYS

The API_KEY allows others to execute tasks stored in the namespace while ensuring that the API_KEY registrant pays for the execution.

Granting Permission: The grants permission to the by calling the command within the Truebit CLI.

Creating an API Key: The Task Requester creates a new API key by calling the command from the Truebit CLI.

Registering the API Key: The Task Requester registers the API key by calling the command from the CLI. The person who registers the API key will be responsible for paying for the task execution, regardless of who calls the task.

Validation and Execution: The service validates that the API key has permission to execute tasks within the task namespace. If verified, the dispatcher starts the task execution workflow.

To allow an address to execute tasks stored in a namespace, the namespace owner must grant permission. This can be done by calling the command from the CLI. Only the namespace owner has the authority to grant this permission. If the namespace owner wants to revoke the previously granted permission, they should call the command from the CLI.

Any user with granted permission to a namespace can generate their own API_KEYS using the command from the CLI. The user who generates the API_KEY must register it by calling the command. The user who registers the API_KEY becomes the payer for any task execution made using that API_KEY.

If the registrant wants to deregister the API_KEY so that no one else with the API key can execute tasks, they should call the command from the CLI.

To use the API KEY to execute a task, please look at the endpoint.

Task Execution
auth new-apikey
auth register
Auth Commands
auth grant
auth revoke
auth register
auth deregister
auth check-authorization
auth get-payer
auth new-apikey
auth grant
auth revoke
auth new-apikey
auth register
auth deregister
Dispatcher
auth grant
Task Authorization Process
Namespace owner
Task Requester